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
deploy: state the backend port once and derive every other statement from it #21400
Found while fixing #21343. The backend's listen port (the same literal) is stated independently in several places in the deploy tree, none deriving from another:
Open decision (from #21435): where static inventories take the backend ports from.
inventory.yml, inventory/hosts.yml, hosts-router.yml and slm-nodes.yml define neither backend_port nor backend_nginx_port. The registry inventory, the dynamic generator, production.yml and — with #21435 — SLM-driven one-host deploys carry both from the single config source.
Two sites render a plain-http proxy upstream that falls back to 8443, the TLS port, when backend_port is undefined: roles/frontend/templates/nginx-frontend.conf.j2 (the upstream) and roles/frontend/tasks/main.yml (its display line). That is the behaviour on main and is kept so those inventories do not abort: wrong, but working. The three TLS probes (key rotation, enforcement toggle, remote backend deploy) and the health-check probes fall back to 8443 as on main, which is correct for a TLS URL.
Decision needed: should the static inventories declare the ports (and where, without adding a second literal), derive them from the single config source at load, or be retired — and once that is settled, should the frontend upstream use the plain-port variable with no fallback? Until decided, all fallbacks stay as on main and a test pins them.
#21435 does not close this issue: the criteria on a single declaration and on a test that fails on a second literal remain open.
Finding from review of the updater batch (#21435): the static production inventory is inconsistent for frontend hosts, and it is unchanged by that PR.
What the inventory says: all.vars sets backend_port: 8001 and backend_protocol: "https" and defines no backend_nginx_port. Only the backend host's own group sets backend_port: 8001, backend_nginx_port: 8443 (commented "nginx external TLS port") and backend_protocol: "http" (commented "uvicorn binds plain HTTP on localhost").
Render for a frontend host (nginx upstream port and proxy scheme), plain jinja2 over the two expressions:
main
branch (scheme-matched port)
frontend host
8001 over https
8001 over https
backend host
8001 over http
8001 over http
So the frontend upstream sends TLS to the plain listener on the static inventory both before and after the batch; the registry and bare-host paths now render the TLS port. Fixing it means either adding backend_nginx_port to all.vars (value 8443, which changes the rendered port from 8001 to 8443) or changing backend_protocol/backend_port there. Which is right depends on whether the TLS listener is reachable from frontend hosts, which the inventory comments assert but nothing in the repository proves. This is the open question on where static inventories take their ports from; leaving it for that decision.
Closure pass against origin/main at 5b3508e8db (#21435). Nothing ticked: #21435 delivered the scheme-matched port and SSOT ports for generated and bare-host inventories, and says it does not close this issue.
Criterion
Verdict
Evidence
One declaration of the port, sourced from the SSOT config; every other statement derives from it
unchecked
git grep -nE "backend_port:\s*[0-9]+" origin/main -- autobot-slm-backend/ansible still returns literals in inventory/production.yml:39,109, playbooks/vars/backend-env.yml:23, roles/backend/defaults/main.yml:32, roles/monitoring/defaults/main.yml:131, roles/backend_services/tasks/main.yml:156, and 8443 in three playbooks; inventory/dynamic/generate_inventory.py:50 has its own default.
The generated inventory's global vars carry it, so no play depends on include order
unchecked
tests/test_bare_inventory_carries_ssot_ports_21400.py covers bare single-host commands; the updater's generated inventory in services/inventory_builder.py has no backend_port reference.
A repo test fails if a second literal is added
unchecked
No such test found; tests/test_port_fallbacks_kept_as_on_main_21400.py pins the existing fallbacks instead.
The open decision on static inventories (comments above) is still pending.
Activity
fix(deploy): https probes read the nginx TLS port, not the plain back…
fix(ansible): the plain proxy port has no 8443 default and the TLS pr…
fix(deploy): bare-inventory ansible commands carry the SSOT backend p…
fix(ansible): sites that rendered a port with a fallback on main keep…
fix(slm): the per-node-port test builds its node the way the inventor…
test(slm): the port helper reads only the port keys, the single-host …
mrveiss commentedon Nov 12, 2026
Open decision (from #21435): where static inventories take the backend ports from.
inventory.yml,inventory/hosts.yml,hosts-router.ymlandslm-nodes.ymldefine neitherbackend_portnorbackend_nginx_port. The registry inventory, the dynamic generator,production.ymland — with #21435 — SLM-driven one-host deploys carry both from the single config source.Two sites render a plain-http proxy upstream that falls back to 8443, the TLS port, when
backend_portis undefined:roles/frontend/templates/nginx-frontend.conf.j2(the upstream) androles/frontend/tasks/main.yml(its display line). That is the behaviour onmainand is kept so those inventories do not abort: wrong, but working. The three TLS probes (key rotation, enforcement toggle, remote backend deploy) and the health-check probes fall back to 8443 as onmain, which is correct for a TLS URL.Decision needed: should the static inventories declare the ports (and where, without adding a second literal), derive them from the single config source at load, or be retired — and once that is settled, should the frontend upstream use the plain-port variable with no fallback? Until decided, all fallbacks stay as on
mainand a test pins them.#21435 does not close this issue: the criteria on a single declaration and on a test that fails on a second literal remain open.
fix(ansible): health-check probes read the TLS port from the backend …
10 remaining items
fix(deploy): the generated inventory carries backend_port from the SS…
chore(ci): run the suite on the head synced with main (#21400)
fix(updater): the fallback pins follow the shared port variable (#21400)
mrveiss commentedon Nov 13, 2026
Finding from review of the updater batch (#21435): the static production inventory is inconsistent for frontend hosts, and it is unchanged by that PR.
What the inventory says:
all.varssetsbackend_port: 8001andbackend_protocol: "https"and defines nobackend_nginx_port. Only the backend host's own group setsbackend_port: 8001,backend_nginx_port: 8443(commented "nginx external TLS port") andbackend_protocol: "http"(commented "uvicorn binds plain HTTP on localhost").Render for a frontend host (nginx upstream port and proxy scheme), plain jinja2 over the two expressions:
8001overhttps8001overhttps8001overhttp8001overhttpSo the frontend upstream sends TLS to the plain listener on the static inventory both before and after the batch; the registry and bare-host paths now render the TLS port. Fixing it means either adding
backend_nginx_porttoall.vars(value 8443, which changes the rendered port from 8001 to 8443) or changingbackend_protocol/backend_portthere. Which is right depends on whether the TLS listener is reachable from frontend hosts, which the inventory comments assert but nothing in the repository proves. This is the open question on where static inventories take their ports from; leaving it for that decision.fix(updater): the husk-clearing includes are each checked for their o…
fix(repo-tests): the anchor-assertion check reads parsed assert tasks…
Merge pull request #21435 from mrveiss/issue-21400-updater-batch
github-actions commentedon Nov 14, 2026
Landed in #21435, merge
5b3508e8dbmrveiss commentedon Nov 14, 2026
Closure pass against
origin/mainat5b3508e8db(#21435). Nothing ticked: #21435 delivered the scheme-matched port and SSOT ports for generated and bare-host inventories, and says it does not close this issue.git grep -nE "backend_port:\s*[0-9]+" origin/main -- autobot-slm-backend/ansiblestill returns literals ininventory/production.yml:39,109,playbooks/vars/backend-env.yml:23,roles/backend/defaults/main.yml:32,roles/monitoring/defaults/main.yml:131,roles/backend_services/tasks/main.yml:156, and8443in three playbooks;inventory/dynamic/generate_inventory.py:50has its own default.tests/test_bare_inventory_carries_ssot_ports_21400.pycovers bare single-host commands; the updater's generated inventory inservices/inventory_builder.pyhas nobackend_portreference.tests/test_port_fallbacks_kept_as_on_main_21400.pypins the existing fallbacks instead.The open decision on static inventories (comments above) is still pending.