Skip to content

Conversation

@stejskalleos
Copy link
Contributor

@stejskalleos stejskalleos commented Oct 31, 2025

No description provided.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Why did you go with a separate playbook instead of a adding a feature?

306b10e and 329bd48 would need to be reverted, but also made optional.

Design wise I'd like to use #188 to specify you want to add a Foreman Proxy (as a feature).

@ehelms
Copy link
Member

ehelms commented Nov 4, 2025

Why did you go with a separate playbook instead of a adding a feature?

I know I suggested going this route to get started since the feature implementation is not flushed out, and having a dedicated command allows for easy testing and conceptualizing right now. And helps start off with a "clean" split between Foreman and smart-proxy.

@ekohl
Copy link
Member

ekohl commented Nov 4, 2025

Ok. As long as the Ansible role prepares for extension then we can later include it with proper features support into the main deploy playbook

Comment on lines 58 to 59
- name: Configure Foreman Proxy
theforeman.foreman.smart_proxy:

Choose a reason for hiding this comment

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

Shouldn't we consider configuring the foreman_proxy and its container, during foremanctl deploy time, since it doesn't create default proxy for the foreman deployment yet?

Copy link
Member

Choose a reason for hiding this comment

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

Take a look at: #279 (comment)

And then, I'd be curious, why do you think deploy should include a foreman-proxy by default?

Choose a reason for hiding this comment

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

I was checking the endpoint we use -> https://satellite.example.com/api/v2/smart_proxies with data {"search": "name=satellite.example.com"} and it returned empty results for the proxy present by default.
Also, I'm curious how we'd handle the external proxy ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, I'm curious how we'd handle the external proxy ?

In future PR, not this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tested the search in UI and it works fine, weird it doesn't work for API.

Copy link
Contributor Author

@stejskalleos stejskalleos Nov 10, 2025

Choose a reason for hiding this comment

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

Be careful, the first proxy is named satellite.example.com-pulp

@stejskalleos stejskalleos changed the title Smart Proxy Foreman Proxy Nov 10, 2025
@stejskalleos
Copy link
Contributor Author

  • Renamed to Foreman Proxy
  • Added test

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

For configuration it might be time to dust off theforeman/smart-proxy#656 again. Not as something we need to get done before we release it, but keep it in mind.

server_url: "{{ foreman_url }}"
username: "{{ foreman_initial_admin_username }}"
password: "{{ foreman_initial_admin_password }}"
validate_certs: false
Copy link
Member

Choose a reason for hiding this comment

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

IMHO we should always validate certificates. We should have them on the system already.

Copy link
Member

Choose a reason for hiding this comment

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

On the system yes, but not in the system trust. you'll have to use ca_path parameter to the module (which we currently also don't do for the pulp proxy)

Copy link
Member

Choose a reason for hiding this comment

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

Follow up issue for foremanctl 3.0?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Clarification for the 3.0 ticket:
Do we want to support the ca_path parameter for the Ansible module, or do we want to add the CA to the trusted store?

Copy link
Member

Choose a reason for hiding this comment

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

ca_path, we should not alter the trust store.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines +64 to +56
username: "{{ foreman_initial_admin_username }}"
password: "{{ foreman_initial_admin_password }}"
Copy link
Member

Choose a reason for hiding this comment

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

This is unreliable, since the user may change username & password after installation. The oauth credentials should be reliable.

Copy link
Member

Choose a reason for hiding this comment

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

Our Ansible collection can't do OAutho tho.

Copy link
Member

Choose a reason for hiding this comment

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

username: "{{ foreman_initial_admin_username }}"
password: "{{ foreman_initial_admin_password }}"
has the same issue

Copy link
Member

Choose a reason for hiding this comment

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

Oh, that's going to be some reliability issue down the line. We should track that somehow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Can I, as a user, run this on its own host and foremanctl foreman-proxy --foreman-url https://foreman.example.com or is that fully out of scope for now?

@@ -0,0 +1,2 @@
---
:enabled: https
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this to be done in foremanctl? I see 2 options:

  1. Properly templated in foremanctl where the user can enable/disable the module via a variable
  2. The container image defaults it to this and we don't override it at all

My preference would be to keep it simple and go for option 2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right now the image does not do it by default, so should I move the logic from here to the image?

I can do it, but if we are going to manage the other features and their templates with foremanctl, IMHO, we can keep it as it is.

Copy link
Member

Choose a reason for hiding this comment

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

I tend to agree. While logging is a tad special (as we're effectively abusing it for the proxy to work at all here), we'll be adding more modules soon, and those will be configurable, so… leave it here as is and (maybe) make it configurable later

hostname: "{{ ansible_fqdn }}"
secrets:
- 'foreman-proxy-settings-yaml,type=mount,target=/etc/foreman-proxy/settings.yml'
- 'foreman-proxy-logs-yaml,type=mount,target=/etc/foreman-proxy/settings.d/logs.yml'
Copy link
Member

Choose a reason for hiding this comment

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

Not a blocking comment, but this is more a forward thinking discussion, but we know it's coming soon so it's best to start thinking about it.

Thinking more about this, how are we going to make it extensible? We know there will be many modules. Just to name a few off the top of my head:

  • REX
  • DHCP (with a provider, so at least 2 config files)
  • DNS (also with a provider)
  • TFTP
  • Realm

Design wise we may want to split those out into into separate Ansible task files. How are we going to add the secrets? Will we use systemd drop in files to keep the container file here reasonably simple?

Copy link
Member

@evgeni evgeni Nov 11, 2025

Choose a reason for hiding this comment

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

I think /etc/containers/systemd/foreman-proxy.container.d/<feature>.conf makes a lot of sense for this.

@evgeni
Copy link
Member

evgeni commented Nov 11, 2025

Can I, as a user, run this on its own host and foremanctl foreman-proxy --foreman-url https://foreman.example.com or is that fully out of scope for now?

Right now it's not exposed and I think should belong into a separate PR (especially as it implies having some way to transfer certificate bundles)

:bind_host: '*'

:log_level: INFO
:log_file: JOURNAL
Copy link
Member

Choose a reason for hiding this comment

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

I didn't expect this to work, but it does. Magic.

Is there any benefit over STDOUT (which will also work in the OpenShift case)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know TBH, not really sure how this smart-proxy -> container -> journal relationship works under the hood, so I'll leave the final decision up to you

Copy link
Member

@evgeni evgeni Nov 11, 2025

Choose a reason for hiding this comment

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

Then I think I'd prefer the plain STDOUT

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps we can start with journal now and investigate whether Foreman Proxy can learn to autodetect it?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

theforeman/smart-proxy#925 is what I was thinking about. Not something we need to sort out right now, but I'm starting to think about ways we can make foreman-proxy itself more container native.

Copy link
Member

@evgeni evgeni left a comment

Choose a reason for hiding this comment

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

Two last small things, then we can get this in.

Thanks!

foremanctl setup-foreman-proxy command for deploying Foreman Proxy.
@evgeni evgeni merged commit ccdae0d into theforeman:master Nov 13, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants