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 #23727 - Rely on puppet-pulp to migrate the database #417

Merged
merged 1 commit into from
Dec 4, 2019

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Nov 29, 2019

https://github.com/theforeman/puppet-pulp/blob/9ee5f9e9539754a2a270695a70911dd6417a4de8/manifests/database.pp#L11-L18 should already take care of this. By removing the marker file we guarantee it runs. It also ensures the correct services are running prior to migration.

if katello || foreman_proxy_content
upgrade_step :migrate_pulp, :run_always => true
if File.exist?(PULP2_MIGRATION_MARKER_FILE)
File.unlink(PULP2_MIGRATION_MARKER_FILE)
Copy link
Member

Choose a reason for hiding this comment

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

Why unlink?

Copy link
Member Author

Choose a reason for hiding this comment

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

https://puppet.com/docs/puppet/latest/type.html#exec-attribute-creates (currently direct links are broken) states:

creates => # A file to look for before running the command...

The exec runs pulp-manage-db && touch /var/lib/pulp/init.flag. That makes it idempotent. By removing the file, we trigger the exec and thus a database migration.

@ehelms ehelms merged commit cc57f72 into theforeman:develop Dec 4, 2019
@ekohl ekohl deleted the 23727-pulp-migration branch December 4, 2019 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants