diff --git a/manifests/database.pp b/manifests/database.pp index 3709ab76..87db9ee6 100644 --- a/manifests/database.pp +++ b/manifests/database.pp @@ -2,6 +2,7 @@ # @api private class pulpcore::database ( Integer[0] $timeout = 3600, + Boolean $always_run_migrations = true, ) { if $pulpcore::postgresql_manage_db { include postgresql::client @@ -28,8 +29,14 @@ Class['postgresql::server::service'] ~> Service['pulpcore-content.service'] } + $migrate_unless = $always_run_migrations ? { + false => 'pulpcore-manager migrate --check', + default => undef, + } + pulpcore::admin { 'migrate --noinput': timeout => $timeout, + unless => $migrate_unless, refreshonly => false, } diff --git a/spec/acceptance/hieradata/common.yaml b/spec/acceptance/hieradata/common.yaml index 72518b13..411c62fb 100644 --- a/spec/acceptance/hieradata/common.yaml +++ b/spec/acceptance/hieradata/common.yaml @@ -3,3 +3,4 @@ apache::default_mods: false pulpcore::apache_https_cert: '/etc/pulpcore-certs/ca-cert.pem' pulpcore::apache_https_key: '/etc/pulpcore-certs/ca-key.pem' pulpcore::apache_https_ca: '/etc/pulpcore-certs/ca-cert.pem' +pulpcore::database::always_run_migrations: false