You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(infra): deploy-backend-env.yml renders backend.env.j2 with variables it never defines #21496
Found while fixing #20894 (PR #20980). The playbook loads no role and takes its variables from playbooks/vars/backend-env.yml. A static check of every variable backend.env.j2 reads without a guard (a default filter, an is defined test, or an enclosing if that establishes it), against what the playbook defines, finds five undefined: backend_chromadb_auth_token, backend_frontend_tls_enabled, backend_prometheus_scrape_token, frontend_http_port, frontend_tls_port. The updater path avoids this by invoking the role's env_only tasks, which put the role defaults in scope.
Fix at the root: render through the same env_only path instead of a second variable set. The check in repo_tests/ansible_log_dir_templates_complete_and_ensured_20894_test.py freezes these five as a shrinking baseline until then.
Second instance of the same class: roles/backend_services/tasks/main.yml renders a backend.env.j2 that the role does not ship (the role has no templates directory) and is referenced by playbooks/deploy-full.yml; site.yml already notes it as dangling. The same check lists it as a frozen, shrink-only unresolvable rendering.
Refs #20894.
Correction: the first version of the check listed eight variables; three were false positives of its rule. autobot_admin_password and backend_postgres_password are read only inside the body of an {% if x | default('') | length > 0 %} block, and tls_ca_cert.stat.exists | default(false) carries a default, so none of the three fails an undefined render. The rule is now decided per read and understands an enclosing if that establishes the name. The real count is five (listed in the body). The dangling backend_services render was added.
Note: playbooks/vars/backend-env.yml also declares backend_log_dir (and other values) at vars-file precedence, which outranks an inventory override in the playbooks that load it. That is pre-existing and was not changed by #20894; the file's own comment on backend_workers describes the same hazard. The new backend_app_log_dir is deliberately not declared there: the deploy playbook derives it only when the inventory leaves it undefined, and the update path takes the role default.
Activity
github-actions commentedon Nov 13, 2026
needs-structure: this issue is missing:Parent: #Nin the body), unless this is an umbrella with sub-issuesThe label clears on the next issue event once all three are present (#19522).
mrveiss commentedon Nov 13, 2026
Correction: the first version of the check listed eight variables; three were false positives of its rule.
autobot_admin_passwordandbackend_postgres_passwordare read only inside the body of an{% if x | default('') | length > 0 %}block, andtls_ca_cert.stat.exists | default(false)carries a default, so none of the three fails an undefined render. The rule is now decided per read and understands an enclosingifthat establishes the name. The real count is five (listed in the body). The danglingbackend_servicesrender was added.mrveiss commentedon Nov 13, 2026
Note:
playbooks/vars/backend-env.ymlalso declaresbackend_log_dir(and other values) at vars-file precedence, which outranks an inventory override in the playbooks that load it. That is pre-existing and was not changed by #20894; the file's own comment onbackend_workersdescribes the same hazard. The newbackend_app_log_diris deliberately not declared there: the deploy playbook derives it only when the inventory leaves it undefined, and the update path takes the role default.