Add deps to all that is needed

1) Add deps to all that is needed.
2) Remove useless hooks
3) Update releated spec tests.

Change-Id: Ic69d8af5f28f5ccb6d0439ef3189522b8ab40b92
This commit is contained in:
ZhongShengping 2016-12-16 09:39:15 +08:00
parent 44900a04a4
commit 49ab8921ca
6 changed files with 27 additions and 8 deletions

View File

@ -42,6 +42,8 @@ class murano::db::mysql_cfapi(
$collate = 'utf8_general_ci',
) {
include ::murano::deps
validate_string($password)
::openstacklib::db::mysql{ 'murano_cfapi':
@ -54,5 +56,8 @@ class murano::db::mysql_cfapi(
allowed_hosts => $allowed_hosts,
}
::Openstacklib::Db::Mysql['murano_cfapi'] ~> Exec<| title == 'murano-cfapi-dbmanage' |>
Anchor['murano::db::begin']
~> Class['murano::db::mysql_cfapi']
~> Anchor['murano::db::end']
}

View File

@ -32,6 +32,8 @@ class murano::db::postgresql_cfapi(
$privileges = 'ALL',
) {
include ::murano::deps
validate_string($password)
::openstacklib::db::postgresql { 'murano_cfapi':
@ -42,6 +44,8 @@ class murano::db::postgresql_cfapi(
privileges => $privileges,
}
::Openstacklib::Db::Postgresql['murano_cfapi'] ~> Exec<| title == 'murano-cfapi-dbmanage' |>
Anchor['murano::db::begin']
~> Class['murano::db::postgresql_cfapi']
~> Anchor['murano::db::end']
}

View File

@ -3,13 +3,9 @@
#
class murano::db::sync_cfapi {
include ::murano::deps
include ::murano::params
Package <| title == 'murano-common' |> ~> Exec['murano-cfapi-dbmanage']
Exec['murano-cfapi-dbmanage'] ~> Service <| tag == 'murano-service' |>
Murano_cfapi_config <| title == 'database/connection' |> ~> Exec['murano-cfapi-dbmanage']
exec { 'murano-cfapi-dbmanage':
command => $::murano::params::cfapi_dbmanage_command,
path => '/usr/bin',
@ -18,6 +14,12 @@ class murano::db::sync_cfapi {
try_sleep => 5,
tries => 10,
logoutput => on_failure,
subscribe => [
Anchor['murano::install::end'],
Anchor['murano::config::end'],
Anchor['murano::dbsync::begin']
],
notify => Anchor['murano::dbsync::end'],
}
}

View File

@ -49,6 +49,8 @@ class murano::db_cfapi (
$database_db_max_retries = $::os_service_default,
) {
include ::murano::deps
if !is_service_default($database_connection) {
validate_re($database_connection, '^(mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')

View File

@ -104,6 +104,8 @@ class murano::logging_cfapi(
$log_date_format = $::os_service_default,
) {
include ::murano::deps
oslo::log { 'murano_cfapi_config':
debug => $debug,
use_syslog => $use_syslog,

View File

@ -10,7 +10,11 @@ describe 'murano::db::sync_cfapi' do
:path => '/usr/bin',
:user => 'murano_cfapi',
:refreshonly => 'true',
:logoutput => 'on_failure'
:logoutput => 'on_failure',
:subscribe => ['Anchor[murano::install::end]',
'Anchor[murano::config::end]',
'Anchor[murano::dbsync::begin]'],
:notify => 'Anchor[murano::dbsync::end]',
)
end