Skip to content

Commit 22c8ca2

Browse files
mrveissclaude
andcommitted
fix(ansible): use set_fact to override slm_colocated_frontend — include_vars beats task vars
include_vars has Ansible precedence 18 while task-level vars: has 17. Loading slm_manager/defaults/main.yml (which has slm_colocated_frontend: false) via include_vars was silently overriding vars: slm_colocated_frontend: true on the template task, so the template always rendered in non-co-located mode. Replace vars: on the template task with an explicit set_fact (precedence 19) that runs after include_vars, ensuring the template sees true. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f0ab7a7 commit 22c8ca2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

autobot-slm-backend/ansible/playbooks/provision-fleet-roles.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,14 +349,20 @@
349349
when: _is_slm_frontend_colocated | bool
350350
tags: ['frontend', 'slm-nginx', 'provision']
351351

352+
# include_vars (precedence 18) would override task vars (17) so use
353+
# set_fact (precedence 19) to win over the defaults' false value.
354+
- name: "SLM | Override slm_colocated_frontend=true for co-located re-render"
355+
ansible.builtin.set_fact:
356+
slm_colocated_frontend: true
357+
when: _is_slm_frontend_colocated | bool
358+
tags: ['frontend', 'slm-nginx', 'provision']
359+
352360
- name: "SLM | Re-render SLM nginx config for co-located mode (#3012)"
353361
ansible.builtin.template:
354362
src: "{{ playbook_dir }}/../roles/slm_manager/templates/autobot-slm.conf.j2"
355363
dest: "/etc/nginx/sites-available/{{ slm_nginx_config | default('autobot-slm') }}"
356364
mode: "0644"
357365
backup: true
358-
vars:
359-
slm_colocated_frontend: true
360366
when: _is_slm_frontend_colocated | bool
361367
register: _slm_nginx_rerendered
362368
tags: ['frontend', 'slm-nginx', 'provision']

0 commit comments

Comments
 (0)