Skip to content

bug(infra): deploy-backend-env.yml renders backend.env.j2 with variables it never defines #21496

Open

Description

@mrveiss

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.

Activity

  1. added
    needs-structureMissing goal milestone, matching phase label or native parent (#19522)
    on Nov 13, 2026
  2. github-actions commented on Nov 13, 2026

    @github-actions
    Contributor

    needs-structure: this issue is missing:

    • a native parent issue (add one, or write Parent: #N in the body), unless this is an umbrella with sub-issues

    The label clears on the next issue event once all three are present (#19522).

  3. mrveiss commented on Nov 13, 2026

    @mrveiss
    OwnerAuthor

    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.

  4. mrveiss commented on Nov 13, 2026

    @mrveiss
    OwnerAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginfrastructureneeds-structureMissing goal milestone, matching phase label or native parent (#19522)phase:M1.7Docker docs and the docs close-outpriority: medium

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions