Moved keystone db sync to its own class

This will decouple allowing for additions, like the apache wsgi
patch, so it can be included or triggered elsewhere.

Original author is François Charlier<francois.charlier@enovance.com>

Change-Id: I9ae544d58034ca30ddb0a4c616ff794ccd432d7f
This commit is contained in:
Matthew Black
2013-11-05 12:00:06 -05:00
parent 27005c74d9
commit 2d8a7504e0
3 changed files with 15 additions and 12 deletions

12
manifests/db/sync.pp Normal file
View File

@@ -0,0 +1,12 @@
#
# Class to execute "keystone-manage db_sync
#
class keystone::db::sync {
exec { 'keystone-manage db_sync':
path => '/usr/bin',
user => 'keystone',
refreshonly => true,
subscribe => [Package['keystone'], Keystone_config['sql/connection']],
require => User['keystone'],
}
}

View File

@@ -205,16 +205,8 @@ class keystone(
}
if $enabled {
# this probably needs to happen more often than just when the db is
# created
exec { 'keystone-manage db_sync':
path => '/usr/bin',
user => 'keystone',
refreshonly => true,
notify => Service['keystone'],
subscribe => Package['keystone'],
require => User['keystone'],
}
include keystone::db::sync
Class['keystone::db::sync'] ~> Service['keystone']
}
# Syslog configuration

View File

@@ -94,8 +94,7 @@ describe 'keystone' do
should contain_exec('keystone-manage db_sync').with(
:user => 'keystone',
:refreshonly => true,
:notify => 'Service[keystone]',
:subscribe => 'Package[keystone]',
:subscribe => ['Package[keystone]', 'Keystone_config[sql/connection]'],
:require => 'User[keystone]'
)
end