Add deps to all that is needed

Change-Id: If0e939e567f179e95201c538446ae0c4d180fab8
This commit is contained in:
ZhongShengping 2017-04-18 11:24:14 +08:00
parent fff658cb6f
commit 58a7294656
4 changed files with 22 additions and 8 deletions

View File

@ -45,6 +45,8 @@ class manila::db::mysql (
$mysql_module = undef,
) {
include ::manila::deps
if $mysql_module {
warning('The mysql_module parameter is deprecated. The latest 2.x mysql module will be used.')
}
@ -61,5 +63,7 @@ class manila::db::mysql (
allowed_hosts => $allowed_hosts,
}
::Openstacklib::Db::Mysql['manila'] ~> Exec<| title == 'manila-manage db_sync' |>
Anchor['manila::db::begin']
~> Class['manila::db::mysql']
~> Anchor['manila::db::end']
}

View File

@ -32,6 +32,8 @@ class manila::db::postgresql(
$privileges = 'ALL',
) {
include ::manila::deps
::openstacklib::db::postgresql { 'manila':
password_hash => postgresql_password($user, $password),
dbname => $dbname,
@ -40,6 +42,8 @@ class manila::db::postgresql(
privileges => $privileges,
}
::Openstacklib::Db::Postgresql['manila'] ~> Exec<| title == 'manila-manage db_sync' |>
Anchor['manila::db::begin']
~> Class['manila::db::postgresql']
~> Anchor['manila::db::end']
}

View File

@ -2,11 +2,7 @@
class manila::db::sync {
include ::manila::params
Exec['manila-manage db_sync'] ~> Service<| tag == 'manila-service' |>
Package<| tag == 'manila-package' |> ~> Exec['manila-manage db_sync']
Manila_config<| title == 'database/connection' |> ~> Exec['manila-manage db_sync']
include ::manila::deps
exec { 'manila-manage db_sync':
command => $::manila::params::db_sync_command,
@ -16,5 +12,11 @@ class manila::db::sync {
try_sleep => 5,
tries => 10,
logoutput => 'on_failure',
subscribe => [
Anchor['manila::install::end'],
Anchor['manila::config::end'],
Anchor['manila::dbsync::begin']
],
notify => Anchor['manila::dbsync::end'],
}
}

View File

@ -12,7 +12,11 @@ describe 'manila::db::sync' do
:user => 'manila',
:try_sleep => 5,
:tries => 10,
:logoutput => 'on_failure'
:logoutput => 'on_failure',
:subscribe => ['Anchor[manila::install::end]',
'Anchor[manila::config::end]',
'Anchor[manila::dbsync::begin]'],
:notify => 'Anchor[manila::dbsync::end]',
)
end