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

Update gems to support testing Puppet 8 #476

Merged
merged 2 commits into from
Nov 3, 2023
Merged

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Sep 28, 2023

No description provided.

@ekohl
Copy link
Member Author

ekohl commented Oct 13, 2023

Looks like there is some idempotency issue around the candlepin keystore password file:

  Notice: /Stage[main]/Certs::Candlepin/File[/etc/pki/katello/keystore_password-file]/content: content changed '{sha256}3e7d27401b4b9fd9ec4e0ae56ac5bc8e44ec30d17cea992d4ece230ee85234f4' to '{sha256}dab17449f63856b4995ec58958b1df1451af5f6b1e3af904d188e04211ac1fbf'

Which is weird, because I'd expect that to pass. Looks like this started to fail last week: https://github.com/theforeman/puppet-katello/actions/runs/6427358289

That's around the time I merged the changes to address the CVE, so now I wonder if I messed that up.

@ehelms
Copy link
Member

ehelms commented Oct 13, 2023

Looks like there is some idempotency issue around the candlepin keystore password file:

  Notice: /Stage[main]/Certs::Candlepin/File[/etc/pki/katello/keystore_password-file]/content: content changed '{sha256}3e7d27401b4b9fd9ec4e0ae56ac5bc8e44ec30d17cea992d4ece230ee85234f4' to '{sha256}dab17449f63856b4995ec58958b1df1451af5f6b1e3af904d188e04211ac1fbf'

Which is weird, because I'd expect that to pass. Looks like this started to fail last week: https://github.com/theforeman/puppet-katello/actions/runs/6427358289

That's around the time I merged the changes to address the CVE, so now I wonder if I messed that up.

I can take a look.

@ehelms
Copy link
Member

ehelms commented Oct 13, 2023

So, I am thinking your change simply uncovered a situation that already existed perhaps? There is a weird aspect I do not understand. On first run of the a manifest that calls include katello like our tests do:

# ls /opt/puppetlabs/puppet/cache/foreman_cache_data/
admin_password	ca_key_password  candlepin_db_password	candlepin_oauth_secret	db_password  oauth_consumer_key  oauth_consumer_secret

Notice that he keystore and truststore password files are missing. On the second application those files will exist.

@ekohl
Copy link
Member Author

ekohl commented Oct 17, 2023

I found it: katello pulls in foreman-installer-katello (https://github.com/theforeman/foreman-packaging/blob/8629ae7c79663fca62d289ebff547b0520409c67/packages/katello/katello/katello.spec#L31). We added a migration there that removes the answers (https://github.com/theforeman/foreman-installer/blob/develop/config/katello.migrations/231003142402-reset-store-credentials.rb). So the sequence is:

  • Apply include katello
  • Generates credentials in a cache
  • Installer is installed
  • Migrations run as part of the RPM installation
  • Cache gets removed
  • Apply include katello
  • Generates new credentials in a cache

Result is that the run is not idempotent.

I found this by chance when I used it with the old gems without specifying the Puppet version, which then used Puppet 6. Then the installer refused to install.

@ekohl
Copy link
Member Author

ekohl commented Oct 17, 2023

I pushed a change that I thought would work, but locally it doesn't appear to help. Still investigating.

ekohl added 2 commits October 17, 2023 17:40
The installation of foreman-installer-katello wipes out the candlepin
credentials, which breaks idempotency. By ensuring the migration in
question is in the katello-migrations-applied file we pretend it
actually ran.
Copy link
Member

@ehelms ehelms left a comment

Choose a reason for hiding this comment

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

Ugly, but it gets the job done.

@ekohl ekohl merged commit 36c1a66 into theforeman:master Nov 3, 2023
5 checks passed
@ekohl ekohl deleted the update-gems branch November 3, 2023 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

2 participants