Skip to content

Commit 22f6338

Browse files
mrveissclaude
andcommitted
fix(ansible): preserve wizard's slm_colocated_frontend in role set_fact; fix include_vars precedence in Phase 4c
slm_manager role set_fact was unconditionally overwriting slm_colocated_frontend with the file-detection result, discarding the True value the wizard set in the inventory. Change to OR expression so a wizard-supplied True is preserved. Phase 4c had include_vars (precedence 18) loading defaults with false, then task vars: (precedence 17) trying to set true — always losing. Add an explicit set_fact after include_vars so the correct value wins. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 555f302 commit 22f6338

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,15 +357,15 @@
357357
}}
358358
tags: ['frontend', 'slm-nginx', 'provision']
359359

360+
# Load role defaults so template variables are defined, then immediately
361+
# override slm_colocated_frontend via set_fact (precedence 19 > include_vars 18).
360362
- name: "SLM | Load slm_manager defaults for nginx re-render"
361363
ansible.builtin.include_vars:
362364
file: "{{ playbook_dir }}/../roles/slm_manager/defaults/main.yml"
363365
when: _is_slm_frontend_colocated | bool
364366
tags: ['frontend', 'slm-nginx', 'provision']
365367

366-
# include_vars (precedence 18) would override task vars (17) so use
367-
# set_fact (precedence 19) to win over the defaults' false value.
368-
- name: "SLM | Override slm_colocated_frontend=true for co-located re-render"
368+
- name: "SLM | Set slm_colocated_frontend=true (set_fact wins over include_vars)"
369369
ansible.builtin.set_fact:
370370
slm_colocated_frontend: true
371371
when: _is_slm_frontend_colocated | bool

autobot-slm-backend/ansible/roles/slm_manager/tasks/main.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,11 @@
302302

303303
- name: "SLM | Set co-located frontend flag (#3013)"
304304
ansible.builtin.set_fact:
305-
slm_colocated_frontend: "{{ _colocated_frontend_check.stat.exists | default(false) }}"
305+
slm_colocated_frontend: >-
306+
{{
307+
(slm_colocated_frontend | default(false) | bool) or
308+
(_colocated_frontend_check.stat.exists | default(false) | bool)
309+
}}
306310
tags: ['slm', 'frontend', 'nginx']
307311

308312
# ==========================================================

0 commit comments

Comments
 (0)