Refactor resource dependencies
This refactors resource dependencies to improve the following points. - Avoid unnecessary dependencies across services. For example aodh service does not require cinder db. - Restart only api service when config files like paste.ini, which are used only be api service is changed. This also removes the unused placement-support-package tag. Change-Id: I31bac02c5895dc6f4090c1012db14bcdc1100aa3
This commit is contained in:
parent
ce90275fb2
commit
7fe2730094
|
@ -62,6 +62,9 @@ class placement::api (
|
|||
Service <| title == 'httpd' |> { tag +> 'placement-service' }
|
||||
} else {
|
||||
$api_service_name_real = $api_service_name
|
||||
|
||||
# On any uwsgi config change, we must restart Placement API.
|
||||
Placement_api_uwsgi_config<||> ~> Service['placement-api']
|
||||
}
|
||||
} else {
|
||||
$api_service_name_real = $api_service_name
|
||||
|
|
|
@ -86,4 +86,8 @@ class placement::db (
|
|||
pool_timeout => $database_pool_timeout,
|
||||
mysql_enable_ndb => $mysql_enable_ndb,
|
||||
}
|
||||
|
||||
# all db settings should be applied and all packages should be installed
|
||||
# before dbsync starts
|
||||
Oslo::Db['placement_config'] -> Anchor['placement::dbsync::begin']
|
||||
}
|
||||
|
|
|
@ -24,30 +24,9 @@ class placement::deps {
|
|||
~> Service<| tag == 'placement-service' |>
|
||||
~> anchor { 'placement::service::end': }
|
||||
|
||||
# Support packages need to be installed in the install phase, but we don't
|
||||
# put them in the chain above because we don't want any false dependencies
|
||||
# between packages with the placement-package tag and the placement-support-package
|
||||
# tag. Note: the package resources here will have a 'before' relationship on
|
||||
# the placement::install::end anchor. The line between placement-support-package
|
||||
# and placement-package should be whether or not placement services would
|
||||
# need to be restarted if the package state was changed.
|
||||
Anchor['placement::install::begin']
|
||||
-> Package<| tag == 'placement-support-package'|>
|
||||
-> Anchor['placement::install::end']
|
||||
|
||||
# all db settings should be applied and all packages should be installed
|
||||
# before dbsync starts
|
||||
Oslo::Db<||> -> Anchor['placement::dbsync::begin']
|
||||
|
||||
# policy config should occur in the config block also.
|
||||
Anchor['placement::config::begin']
|
||||
-> Openstacklib::Policy<| tag == 'placement' |>
|
||||
-> Anchor['placement::config::end']
|
||||
|
||||
# On any uwsgi config change, we must restart Placement.
|
||||
Anchor['placement::config::begin']
|
||||
-> Placement_api_uwsgi_config<||>
|
||||
~> Anchor['placement::config::end']
|
||||
-> Anchor['placement::config::end']
|
||||
|
||||
# Installation or config changes will always restart services.
|
||||
Anchor['placement::install::end'] ~> Anchor['placement::service::begin']
|
||||
|
|
|
@ -279,4 +279,6 @@ class placement::keystone::authtoken(
|
|||
service_type => $service_type,
|
||||
interface => $interface;
|
||||
}
|
||||
|
||||
Keystone::Resource::Authtoken['placement_config'] -> Anchor['placement::config::end']
|
||||
}
|
||||
|
|
|
@ -65,11 +65,15 @@ class placement::policy (
|
|||
file_group => $::placement::params::group,
|
||||
file_format => 'yaml',
|
||||
purge_config => $purge_config,
|
||||
tag => 'placement',
|
||||
}
|
||||
|
||||
create_resources('openstacklib::policy', { $policy_path => $policy_parameters })
|
||||
|
||||
# policy config should occur in the config block also.
|
||||
Anchor['placement::config::begin']
|
||||
-> Openstacklib::Policy[$policy_path]
|
||||
-> Anchor['placement::config::end']
|
||||
|
||||
oslo::policy { 'placement_config':
|
||||
enforce_scope => $enforce_scope,
|
||||
enforce_new_defaults => $enforce_new_defaults,
|
||||
|
@ -77,5 +81,4 @@ class placement::policy (
|
|||
policy_default_rule => $policy_default_rule,
|
||||
policy_dirs => $policy_dirs,
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ describe 'placement::policy' do
|
|||
:file_group => 'placement',
|
||||
:file_format => 'yaml',
|
||||
:purge_config => false,
|
||||
:tag => 'placement',
|
||||
)
|
||||
is_expected.to contain_oslo__policy('placement_config').with(
|
||||
:enforce_scope => false,
|
||||
|
@ -64,7 +63,6 @@ describe 'placement::policy' do
|
|||
:file_group => 'placement',
|
||||
:file_format => 'yaml',
|
||||
:purge_config => true,
|
||||
:tag => 'placement',
|
||||
)
|
||||
is_expected.to contain_oslo__policy('placement_config').with(
|
||||
:enforce_scope => false,
|
||||
|
|
Loading…
Reference in New Issue