Skip to content

Remove pulp_rhsm_url override from base vars#618

Open
pablomh wants to merge 1 commit into
theforeman:masterfrom
pablomh:fix/pulp-rhsm-url-capsule-hostname
Open

Remove pulp_rhsm_url override from base vars#618
pablomh wants to merge 1 commit into
theforeman:masterfrom
pablomh:fix/pulp-rhsm-url-capsule-hostname

Conversation

@pablomh

@pablomh pablomh commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Problem

base.yaml set pulp_rhsm_url to foreman_proxy_foreman_server_url which resolves to the Foreman server hostname. On content proxy deployments with --foreman-fqdn, this caused the registration script to point subscription-manager at the Foreman server instead of the content proxy.

Fix

Remove the pulp_rhsm_url override from base.yaml and let the Pulp role default take effect:

pulp_rhsm_url: "https://{{ ansible_facts['fqdn'] }}/rhsm"

This always resolves to the host's own FQDN, which is correct for both Foreman server and content proxy deployments. The content proxy's httpd already reverse-proxies /rhsm to the Foreman server.

Testing

Deployed a content proxy with foremanctl deploy-proxy --foreman-fqdn foreman.example.com. Verified:

  • PULP_SMART_PROXY_RHSM_URL in the running pulp-api container resolves to https://proxy.example.com/rhsm (the proxy's own hostname)
  • Registration scripts rendered via the content proxy point subscription-manager at the proxy

@ekohl ekohl left a comment

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.

Not looking at the details, but more about the context. When submitting PRs upstream, please avoid using downstream terminology. Satellite and Capsule do no exist in upstream, nor should upstream care. Please refer to Foreman server and content proxies instead.

Comment thread src/vars/base.yaml
pulp_content_origin: "https://{{ ansible_facts['fqdn'] }}"
pulp_pulp_url: "https://{{ ansible_facts['fqdn'] }}"
pulp_plugins: "{{ enabled_features | select('contains', 'content/') | map('replace', 'content/', 'pulp_') | list }}"
pulp_rhsm_url: "{{ foreman_proxy_foreman_server_url }}/rhsm"

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.

Could we just remove pulp_rhsm_url from base and fallback to defaults https://github.com/theforeman/foremanctl/blame/master/src/roles/pulp/defaults/main.yaml#L29 which will always be hosts 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.

What it should be:

  • On Foreman server it should be empty
  • On a content proxy it should be the service name that Apache binds to

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.

But i see that in puppet based installer, we did kept it default to fqdn https://github.com/theforeman/puppet-foreman_proxy/blob/master/manifests/plugin/pulp/params.pp#L6 😕

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 hadn't thought such simple solution. Doing that I could remove the addition of foreman_proxy_name as well.

Allow me some time to test it.

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.

But i see that in puppet based installer, we did kept it default to fqdn https://github.com/theforeman/puppet-foreman_proxy/blob/master/manifests/plugin/pulp/params.pp#L6 😕

That predates Katello/katello@46abdb2. 55fa1d2 was the first to make use of it.

So to be clear: for content proxies that have deployed an RHSM proxy it is needed, but when I wrote 55fa1d2 we didn't have those.

@arvind4501 arvind4501 Jul 3, 2026

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.

Thanks for details, so does that mean we will only set rhsm url for content proxy only? sorry if i missed something

i think make sense now, if no pulp_rhsm_url given fallback to foreman_url otherwise used configured pulp_rhsm_url

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.

Thanks for details, so does that mean we will only set rhsm url for content proxy only? sorry if i missed something

Yes.

i think make sense now, if no pulp_rhsm_url given fallback to foreman_url otherwise used configured pulp_rhsm_url

Pretty much.

The idea behind Katello/katello@46abdb2 is that you can decouple Pulp and the RHSM part. For example, you could deploy a scalable Pulp deployment in OpenShift without the RHSM component. In that case, Katello would already know the Foreman URL and point clients there.

We're not there yet, but on a Foreman server (where there is no RHSM proxy) there's no point in setting the URL: Katello already knows it.

base.yaml set pulp_rhsm_url to foreman_proxy_foreman_server_url which
resolves to the Foreman server hostname. On content proxy deployments
with --foreman-fqdn, this caused the registration script to point
subscription-manager at the Foreman server instead of the content proxy.

Remove the override and let the Pulp role default take effect:
  pulp_rhsm_url: "https://{{ ansible_facts['fqdn'] }}/rhsm"

This always resolves to the host's own FQDN, which is correct for both
Foreman server and content proxy deployments. The content proxy's httpd
already reverse-proxies /rhsm to the Foreman server.
@pablomh pablomh force-pushed the fix/pulp-rhsm-url-capsule-hostname branch from 78fcb31 to fad0f4b Compare July 3, 2026 12:24
@pablomh pablomh changed the title Fix pulp_rhsm_url to use capsule hostname on proxy deployments Remove pulp_rhsm_url override from base vars Jul 3, 2026
@pablomh

pablomh commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Now it should be good to go.

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.

3 participants