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

Fixes #32885: Remove puppet from foreman::user_groups if present #690

Merged
merged 1 commit into from
Jul 12, 2021

Conversation

ehelms
Copy link
Member

@ehelms ehelms commented Jun 25, 2021

The change theforeman/puppet-foreman#938
introduced dynamically determining if the puppet group needed to
be added to the foreman user. This no longer needs to be set
explicitly on the foreman::user_groups parameter thus the migration
cleans it up if present.

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.

We can also drop this line:

@@ -0,0 +1,3 @@
if answers['foreman'].is_a?(Hash)
answers['foreman']['user_groups'].delete('puppet') if answers['foreman']['user_groups'].include?('puppet')
Copy link
Member

Choose a reason for hiding this comment

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

Can we make this the same as the Foreman migration? That should be safer.

@@ -23,7 +23,6 @@ foreman:
server_ssl_chain: /etc/pki/katello/certs/katello-server-ca.crt
server_ssl_crl: ""
server_ssl_key: /etc/pki/katello/private/katello-apache.key
user_groups: []
Copy link
Member Author

Choose a reason for hiding this comment

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

I figured this does not need to be here anymore.

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.

👍 pending the merge in puppet-foreman itself.

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.

Would you mind fixing the merge conflict?

@ehelms
Copy link
Member Author

ehelms commented Jun 28, 2021

Around whether to remove the migration file or not:

a) I don't know what happens when you remove a migration that previously existed
b) This creates a difference between a fresh install and an upgrade when looking at the what migrations have been applied that could lead to false positive issues being reported or folks going down a wrong path when investigating issues

This was my rationale for leaving the file and clearing the content.

@ekohl
Copy link
Member

ekohl commented Jul 5, 2021

a) I don't know what happens when you remove a migration that previously existed

Luckily https://github.com/theforeman/kafo/blob/master/lib/kafo/migrations.rb is quite easy to follow. Most crucial is this line. It essentially is a list of (file)names that have already been applied and should be skipped. As such, it should be safe to remove the file. You should only be careful not to change/reuse migration names, but since a timestamp is included that shouldn't happen in practice.

b) This creates a difference between a fresh install and an upgrade when looking at the what migrations have been applied that could lead to false positive issues being reported or folks going down a wrong path when investigating issues

On the other hand, then you can know what they followed. The real migration or not. With this it'll be impossible to determine.

Given that, I'm in favor of removing the migration rather than keeping a dummy.

@ehelms ehelms requested a review from wbclark July 8, 2021 12:30
The change theforeman/puppet-foreman#938
introduced dynamically determining if the puppet group needed to
be added to the foreman user. This no longer needs to be set
explicitly on the foreman::user_groups parameter thus the migration
cleans it up if present.
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.

Thanks!

@ekohl ekohl merged commit e7b5cdd into theforeman:develop Jul 12, 2021
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.

4 participants