Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure proxy register runs before puppetserver service #852

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

bastelfreak
Copy link
Member

In case there runs puppetserver on the same node and foreman is used as an ENC, the registration needs to happen before the smart proxy is configured, otherwise the ENC script cannot authenticate itself to foreman.

In case there runs puppetserver on the same node *and* foreman is used
as an ENC, the registration needs to happen before the smart proxy is
configured, otherwise the ENC script cannot authenticate itself to
foreman.
@ekohl ekohl enabled auto-merge (rebase) December 12, 2024 16:40
@ekohl
Copy link
Member

ekohl commented Dec 12, 2024

CI fails on AL 8 and Ubuntu 20.04 since we dropped those from nightly. I saw the same thing in puppet-foreman and we'll need to drop them. In the mean time I'll merge this manually.

@ekohl ekohl disabled auto-merge December 12, 2024 17:09
@ekohl ekohl merged commit c77cc72 into theforeman:master Dec 12, 2024
14 of 19 checks passed
@bastelfreak bastelfreak deleted the puppetserver branch December 12, 2024 17:16
@evgeni
Copy link
Member

evgeni commented Dec 13, 2024

Yeah, no :)

This breaks when you try to re-generate all certs, as it tries to register the proxy before puppetserver has created a CA:

2024-12-12T23:21:17  [E] Disabling all modules in the group ['puppetca_http_api', 'puppetca_hostname_whitelisting', 'puppetca'] due to a failure in one of them: File at '/etc/puppetlabs/puppet/ssl/certs/ca.pem' defined in 'puppet_ssl_ca' parameter doesn't exist or is unreadable
2024-12-12T23:21:17  [W] Error details for Disabling all modules in the group ['puppetca_http_api', 'puppetca_hostname_whitelisting', 'puppetca'] due to a failure in one of them: File at '/etc/puppetlabs/puppet/ssl/certs/ca.pem' defined in 'puppet_ssl_ca' parameter doesn't exist or is unreadable: <Proxy::Error::ConfigurationError>: File at '/etc/puppetlabs/puppet/ssl/certs/ca.pem' defined in 'puppet_ssl_ca' parameter doesn't exist or is unreadable

@bastelfreak
Copy link
Member Author

Where are you seeing this problem? Do you have a bit more context? Maybe we can add a conditional to the resource collector.

@evgeni
Copy link
Member

evgeni commented Dec 13, 2024

The problem is when we run katello-change-hostname, which wipes all existing certificates and relies on the fact that they will be regenerated on start of the service (the tl;dr is: it wipes certs and then calls the installer/puppet).

I guess calling puppetserver ca setup as part of k-c-h would help here

@evgeni
Copy link
Member

evgeni commented Dec 16, 2024

No, that's not it. As the CA is still fine:

# puppetserver ca setup
Error:
Existing file at '/etc/puppetlabs/puppetserver/ca/ca_crt.pem'
Existing file at '/etc/puppetlabs/puppetserver/ca/ca_crl.pem'
Existing file at '/etc/puppetlabs/puppetserver/ca/infra_crl.pem'
Existing file at '/etc/puppetlabs/puppetserver/ca/ca_pub.pem'
Existing file at '/etc/puppetlabs/puppetserver/ca/inventory.txt'
Existing file at '/etc/puppetlabs/puppetserver/ca/infra_inventory.txt'
Existing file at '/etc/puppetlabs/puppetserver/ca/infra_serials'
Existing file at '/etc/puppetlabs/puppetserver/ca/serial'
Existing file at '/etc/puppetlabs/puppetserver/ca/root_key.pem'
Existing file at '/etc/puppetlabs/puppetserver/ca/ca_key.pem'
If you would really like to replace your CA, please delete the existing files first.
Note that any certificates that were issued by this CA will become invalid if you
replace it!

But what puts the copy into /etc/puppetlabs/puppet/ssl/certs/ and generates the client stuff? 🤔

@evgeni
Copy link
Member

evgeni commented Dec 16, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants