Skip to content

Conversation

@ehelms
Copy link
Member

@ehelms ehelms commented Sep 13, 2024

Alternative to #461. This does include the tests from 461, but not the re-factorings. I wanted to have as crisp of a solution to the regression as possible. The re-factoring, which I like, we can layer on top of the fix afterward.

If you rewind to 433dadc, prior to this change, the ca resource was used to perform the copying to the server CA in the build root. This resource had the generate parameter built into it. This is what prevented the current regression from happening in the old design. When deploying a foreman-proxy-content scenario in the installer, we are supplying all the certificates in the tarball. Therefore no generation needs to occur. Which we can see as the case by looking at the answers file (https://github.com/theforeman/foreman-installer/blob/develop/config/foreman-proxy-content-answers.yaml#L13C1-L14C1):

certs:
  generate: false

I think this is the correct solution at this point in time, as it restores the prior behavior and fixes the issues (as evidenced by the reproducer tests -- thanks @ekohl).

This issue has given me some ideas on how this could be improved in upcoming releases through some re-factoring and re-design.

describe 'deploy certificates' do
manifest = <<-PUPPET
class { 'certs':
generate => false,
Copy link
Member

Choose a reason for hiding this comment

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

Note to self: this bit I missed in my PR.

ekohl and others added 2 commits September 13, 2024 12:11
This asserts that the default CA and server CA are the same in one
scenario and differ in the other.
Fixes: 433dadc ("Copy the server CA certificate with file resource")
@ekohl ekohl linked an issue Sep 13, 2024 that may be closed by this pull request
@ekohl ekohl enabled auto-merge (rebase) September 13, 2024 10:12
@ekohl
Copy link
Member

ekohl commented Sep 13, 2024

I fixed up my commit message (customer -> custom) and added a Fixes trailer to yours.

@ekohl ekohl merged commit 15a3cc2 into theforeman:master Sep 13, 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.

Custom CA overwritten when certs::server_ca_cert is undefined

2 participants