puppet-barbican/manifests/db/sync.pp
Juan Antonio Osorio Robles a51b1e0d66 Call sync secret store on db-sync
Due to race conditions when doing the secret store sync in the code, we
opted for requiring the command to be explicitly called. This reflects
the new requirement by adding the secret store sync in the db-sync
manifest.

Change-Id: I61544d2defa3fd7f28c312ce94a753f36a2b7d30
Related-Bug: #1738863
2018-03-20 11:06:38 +02:00

57 lines
1.6 KiB
Puppet

#
# Class to execute barbican-db-manage upgrade
#
# == Parameters
#
# [*extra_params*]
# (optional) String of extra command line parameters to append
# to the barbican-db-manage command.
# Defaults to undef
#
# [*secret_store_extra_params*]
# (optional) String of extra command line parameters to append
# to the barbican-db-manage command.
# Defaults to undef
#
class barbican::db::sync(
$extra_params = undef,
$secret_store_extra_params = undef,
) {
include ::barbican::deps
exec { 'barbican-db-manage':
command => "barbican-manage db upgrade ${extra_params}",
path => ['/bin', '/usr/bin', ],
user => 'barbican',
refreshonly => true,
try_sleep => 5,
tries => 10,
logoutput => on_failure,
subscribe => [
Anchor['barbican::install::end'],
Anchor['barbican::config::end'],
Anchor['barbican::dbsync::begin']
],
notify => Exec['barbican-db-manage sync secret stores'],
tag => 'openstack-db',
}
exec { 'barbican-db-manage sync secret stores':
command => "barbican-manage db sync_secret_stores ${secret_store_extra_params}",
path => ['/bin', '/usr/bin', ],
user => 'barbican',
refreshonly => true,
try_sleep => 5,
tries => 10,
logoutput => on_failure,
subscribe => [
Anchor['barbican::install::end'],
Anchor['barbican::config::end'],
Anchor['barbican::dbsync::begin']
],
notify => Anchor['barbican::dbsync::end'],
tag => 'openstack-db',
}
}