Skip to content

Fix httpd proxy backend precedence in deploy-dev playbook - #696

Merged
evgeni merged 1 commit into
theforeman:masterfrom
jeremylenz:fix-httpd-proxy-backend-precedence
Jul 31, 2026
Merged

Fix httpd proxy backend precedence in deploy-dev playbook#696
evgeni merged 1 commit into
theforeman:masterfrom
jeremylenz:fix-httpd-proxy-backend-precedence

Conversation

@jeremylenz

@jeremylenz jeremylenz commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Why are you introducing these changes? (Problem description, related links)

The deploy-dev playbook sets httpd_foreman_backend: "http://localhost:3000" in the play-level vars: block, but src/vars/base.yaml (loaded via vars_files:) overrides it with the Unix socket path. In Ansible's variable precedence, vars_files beats vars, so httpd was always configured to proxy to a nonexistent Unix socket instead of TCP port 3000, resulting in 503 errors.

This was latent since eedbe40 (March 2025) when Unix socket support was added to base.yaml, but went unnoticed because the vars: block originally appeared below vars_files: in the YAML, and the ordering happened to make the override work. #623 ("Move flavor default into playbook vars", July 6 2026) moved vars: above vars_files:, which broke the accidental ordering and surfaced the bug.

What are the changes introduced in this pull request?

  • Add development/vars/devel.yaml with dev-specific variable overrides (currently httpd_foreman_backend)
  • Load it last in vars_files so it overrides base.yaml at the same precedence level
  • Remove the ineffective override from play-level vars:

How to test this pull request

  • Deploy using ./forge deploy-dev --target-host localhost
  • Verify /etc/httpd/conf.d/foreman.conf contains ProxyPass / http://localhost:3000/ (not a Unix socket path)
  • Confirm no 503 errors when accessing Foreman through httpd

Checklist

  • Tests added/updated (if applicable) - No new tests needed; existing httpd functional tests cover this once #715 enables running tests against dev deployments
  • Documentation updated (if applicable) - No documentation changes needed

🤖 Generated with Claude Code

Comment thread development/playbooks/deploy-dev/deploy-dev.yaml Outdated
@jeremylenz

Copy link
Copy Markdown
Contributor Author

Updated the description with some additional info about how the bug was introduced and then surfaced.

@jeremylenz
jeremylenz force-pushed the fix-httpd-proxy-backend-precedence branch 2 times, most recently from 53db5bd to 6056cac Compare July 22, 2026 20:26
Comment thread development/playbooks/deploy-dev/deploy-dev.yaml Outdated
- role: candlepin
- role: httpd
vars:
httpd_foreman_backend: "http://localhost:3000"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am debating whether these should be set in a devel.yaml that we load last in vars_files. Seems a bit cleaner to me, but certainly not blocking.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am beginning to be convinced. any other opinions?

@evgeni evgeni Jul 30, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other person with opinions is out, so we can merge quickly behind his back :p

@jeremylenz
jeremylenz force-pushed the fix-httpd-proxy-backend-precedence branch from 6056cac to e7052e7 Compare July 30, 2026 19:28
Add a development vars file (devel.yaml) loaded after base.yaml in
vars_files to override the Unix socket backend with http://localhost:3000.
Previously, the override was in the play-level vars block, which has
lower precedence than vars_files and was silently ignored.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jeremylenz
jeremylenz force-pushed the fix-httpd-proxy-backend-precedence branch from e7052e7 to 0e2723b Compare July 31, 2026 13:58
@evgeni
evgeni merged commit 5eb6e00 into theforeman:master Jul 31, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants