Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Fixes #22249 - Handle use_autosignfile in migrations #577

Merged
merged 1 commit into from Jan 12, 2018

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Jan 11, 2018

No description provided.

@theforeman-bot
Copy link

Issues: #22249

@stbenjam
Copy link
Contributor

Looks good, just need to fix the rubocop issue

@ekohl
Copy link
Member Author

ekohl commented Jan 11, 2018

Updated. Note I didn't get to test this yet. Forgot we can't take cherry picks in the installer itself with forklift, but since it's a straight copy (with rubocop fixes now) from foreman-installer I'm assuming it should work.

@stbenjam
Copy link
Contributor

stbenjam commented Jan 11, 2018

For migrations I usually drop them into an existing install and run foreman-installer --migrations-only to test.

We have tests here that make sure migrations don't alter the answers file, so answer files need updating whenever we add a migration. Although, this migration doesn't really work with that paradigm, because it'll set the dir param based on the OS.

Why is the default false for use_autosignfile in puppet-foreman_proxy? And even then, why do we need a migration to set the autosign directory? The puppet params.pp looks like it should already pick the right value.

@ekohl
Copy link
Member Author

ekohl commented Jan 11, 2018

I should have just used https://projects.theforeman.org/issues/21856 rather than creating a new issue. Going to try it on the pipeline box now.

@stbenjam
Copy link
Contributor

I see from theforeman/puppet-foreman_proxy@8d6880b why we need the migration to turn on $use_autosignfile, but I don't understand why we have to set the $autosignfile itself in a migration, the params.pp should pick the right value. Am I missing something?

@ekohl
Copy link
Member Author

ekohl commented Jan 11, 2018

After looking into it: the default in params.pp is false. So it ends up being disabled while 1.16 needs it to be true. This code wouldn't actually deliver it to our users that already upgraded to 1.16.

@ekohl
Copy link
Member Author

ekohl commented Jan 11, 2018

I've submitted theforeman/puppet-foreman_proxy#401 to use modern defaults and will update this PR.

@stbenjam
Copy link
Contributor

stbenjam commented Jan 11, 2018

No, I get that, please re-read the above. Totally fine with setting $use_autosign to true. You need to also set that in the answers.

However, there are two params. You are setting the value of the location of the file too, I don't get why. It's not needed, and it's incompatible with how Katello handles migrations. Katello requires migrations already be run against the answers, so they match, but the autosign path is dependent on OS. It's also not needed, params.pp handles it.

@stbenjam
Copy link
Contributor

(Look at the current test failures - it's not because of rubocop)

@ekohl
Copy link
Member Author

ekohl commented Jan 11, 2018

A user could have overridden the puppetdir value and this maintains their setting in the new format. Say a user wants to continue using /etc/puppet even with puppet 4, this makes that possible.

@stbenjam
Copy link
Contributor

stbenjam commented Jan 11, 2018

Erhm, ok, maybe that's fine, the if answers['foreman_proxy'].key?('puppetdir') won't be there on first run of the installer, so to get the tests to pass all you need to do is add use_autosign: true to the answers

@ekohl
Copy link
Member Author

ekohl commented Jan 11, 2018

Updated to update the default answer files and included katello-devel too.

Copy link
Contributor

@stbenjam stbenjam left a comment

Choose a reason for hiding this comment

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

LGTM

@ekohl
Copy link
Member Author

ekohl commented Jan 11, 2018

I am concerned about users who already upgraded to 1.16 and are now stuck with a broken install.

@stbenjam
Copy link
Contributor

You could change the migration to always flip use_autosign to true. It'd only be run once.

Of course, it'd enable autosign again if users explicitly disabled it in the past, I think. Is there some param we could look at that existed pre-1.16?

@ekohl
Copy link
Member Author

ekohl commented Jan 11, 2018

Like this?

@stbenjam
Copy link
Contributor

Looks the same, I think you can get rid of && !answers['foreman_proxy']['use_autosignfile']?

@ekohl
Copy link
Member Author

ekohl commented Jan 12, 2018

Updated

Copy link
Contributor

@stbenjam stbenjam left a comment

Choose a reason for hiding this comment

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

Looks good

@ekohl ekohl merged commit 95fa030 into Katello:master Jan 12, 2018
@ekohl ekohl deleted the 22249-autosign branch January 12, 2018 15:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants