Skip to content

Add Templates feature to foreman-proxy - #519

Merged
stejskalleos merged 2 commits into
theforeman:masterfrom
shubhamsg199:templates-feature
Jul 28, 2026
Merged

Add Templates feature to foreman-proxy#519
stejskalleos merged 2 commits into
theforeman:masterfrom
shubhamsg199:templates-feature

Conversation

@shubhamsg199

Copy link
Copy Markdown
Contributor

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

What are the changes introduced in this pull request?

  • Enable templates feature for foreman-proxy

How to test this pull request

Steps to reproduce:

  • foremanctl deploy --add-feature templates

Checklist

  • Tests added/updated (if applicable)
  • Documentation updated (if applicable)

@shubhamsg199 shubhamsg199 self-assigned this May 25, 2026
@shubhamsg199
shubhamsg199 marked this pull request as draft May 25, 2026 17:31
Comment thread src/playbooks/deploy/metadata.obsah.yaml Outdated
@shubhamsg199
shubhamsg199 marked this pull request as ready for review June 3, 2026 09:30
@shubhamsg199
shubhamsg199 force-pushed the templates-feature branch 3 times, most recently from 77b2cc9 to 6be7b5b Compare June 5, 2026 15:23
Comment thread .github/workflows/test.yml Outdated
@ehelms

ehelms commented Jun 10, 2026

Copy link
Copy Markdown
Member

Does templates need to be in the features.yaml? I do not see how the feature in this PR ensures foreman-proxy gets added.

@shubhamsg199

shubhamsg199 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Does templates need to be in the features.yaml? I do not see how the feature in this PR ensures foreman-proxy gets added.

Yes, templates is declared in features.yaml under the foreman_proxy key (same pattern as bmc). I don't think we have a way to ensure if foreman-proxy gets added.

@shubhamsg199
shubhamsg199 force-pushed the templates-feature branch 4 times, most recently from 713b3d9 to ded1e9b Compare June 11, 2026 17:00
@shubhamsg199

shubhamsg199 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

@ehelms Made some updates that ensures foreman-proxy gets added on the feature install. Not sure if that should be part of this PR.

Comment thread tests/foreman_proxy_test.py Outdated
@shubhamsg199
shubhamsg199 force-pushed the templates-feature branch 2 times, most recently from f0ba618 to b20b505 Compare June 12, 2026 15:23
Comment thread src/filter_plugins/foremanctl.py
@pablomh

pablomh commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Shouldn't the feature by added to foreman_proxy_base_features?

It's currently the default in foreman-installer: https://github.com/theforeman/foreman-installer/blob/0448d5d129f8fe2ea514cfb7fe90857e0e3f15bd/config/foreman-proxy-content-answers.yaml#L30

@ekohl

ekohl commented Jul 3, 2026

Copy link
Copy Markdown
Member

@pablomh that's only for the content proxies, not for the normal install. It could be part of the proxy flavor.

@jeremylenz

Copy link
Copy Markdown
Contributor

@shubhamsg199 What is the status here?

@shubhamsg199
shubhamsg199 force-pushed the templates-feature branch 7 times, most recently from 88fc9f7 to 916293d Compare July 24, 2026 12:08
@shubhamsg199

Copy link
Copy Markdown
Contributor Author

@shubhamsg199 What is the status here?

@jeremylenz Updated the PR, can you take a look?



@pytest.mark.feature('templates')
def test_templates_template_url(obsah_params, server_fqdn):

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.

we'll need #703 (or similar) to make this test work

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.

This tests is currently passing

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.

oh, because you changed it to read the params, not talk to the API to fetch the set value.

Signed-off-by: Shubham Ganar <shubhamsg123m@gmail.com>
Signed-off-by: Shubham Ganar <shubhamsg123m@gmail.com>

@stejskalleos stejskalleos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🍏 LGTM 🍏

  • Code looks clear
  • All comments should be addressed.
  • Tests are present

Tested with Packit, shortly:

Running foremanctl deploy --add-feature templates --templates-listen-on http --templates-url http://foremanctl9.vagrant.lan/ does not affect the *-pulp proxy.

Running foremanctl deploy --add-feature foreman-proxy will automatically enable templates on the newly running Foreman proxy service.

Merging as #675 is waiting for it.

@stejskalleos
stejskalleos enabled auto-merge (squash) July 28, 2026 08:06
@stejskalleos
stejskalleos merged commit f3224d4 into theforeman:master Jul 28, 2026
27 of 29 checks passed
Comment on lines +13 to +19
foreman_proxy_templates_listen_on:
parameter: --templates-listen-on
help: Templates proxy to listen on https, http, or both.
choices:
- http
- https
- both

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.

Why is it needed to expose this? In the old installer we exposed it because it was the way we did, but it was an advanced option. In foremanctl I think shouldn't expose this.

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.

Addressed this in #706

- both
foreman_proxy_templates_url:
parameter: --templates-url
help: URL that hosts will use to contact the proxy for provisioning templates (e.g. http://<proxy-fqdn>:8000). Required when templates feature is enabled.

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.

There is a default which implies it isn't required to specify.

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.

Updated in #706

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.

8 participants