diff --git a/manifests/api.pp b/manifests/api.pp index f3d655a7..7d2dcc1a 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -104,6 +104,12 @@ class heat::api ( hasrestart => true, tag => 'heat-service', } + + # On any paste-api.ini config change, we must restart Heat API. + Heat_api_paste_ini<||> ~> Service['heat-api'] + # On any uwsgi config change, we must restart Heat API. + Heat_api_uwsgi_config<||> ~> Service['heat-api'] + } elsif $service_name == 'httpd' { service { 'heat-api': ensure => 'stopped', @@ -115,6 +121,10 @@ class heat::api ( # we need to make sure heat-api/eventlet is stopped before trying to start apache Service['heat-api'] -> Service[$service_name] + + # On any paste-api.ini config change, we must restart Heat API. + Heat_api_paste_ini<||> ~> Service[$service_name] + } else { fail("Invalid service_name. Either heat-api/openstack-heat-api for \ running as a standalone service, or httpd for being run by a httpd server") diff --git a/manifests/api_cfn.pp b/manifests/api_cfn.pp index f433076b..c1a2d1f2 100644 --- a/manifests/api_cfn.pp +++ b/manifests/api_cfn.pp @@ -107,6 +107,12 @@ class heat::api_cfn ( hasrestart => true, tag => 'heat-service', } + + # On any paste-api.ini config change, we must restart Heat API. + Heat_api_paste_ini<||> ~> Service['heat-api-cfn'] + # On any uwsgi config change, we must restart Heat API. + Heat_api_cfn_uwsgi_config<||> ~> Service['heat-api-cfn'] + } elsif $service_name == 'httpd' { service { 'heat-api-cfn': ensure => 'stopped', @@ -118,6 +124,10 @@ class heat::api_cfn ( # we need to make sure heat-api-cfn/eventlet is stopped before trying to start apache Service['heat-api-cfn'] -> Service[$service_name] + + # On any paste-api.ini config change, we must restart Heat API. + Heat_api_paste_ini<||> ~> Service[$service_name] + } else { fail("Invalid service_name. Either heat-api-cfn/openstack-heat-api-cfn for \ running as a standalone service, or httpd for being run by a httpd server") diff --git a/manifests/cache.pp b/manifests/cache.pp index 6e878b19..03135649 100644 --- a/manifests/cache.pp +++ b/manifests/cache.pp @@ -277,6 +277,10 @@ class heat::cache ( dead_timeout => $dead_timeout, } + # all cache settings should be applied and all packages should be installed + # before service startup + Oslo::Cache['heat_config'] -> Anchor['heat::service::begin'] + heat_config { 'constraint_validation_cache/caching': value => $constraint_validation_caching; 'constraint_validation_cache/expiration_time': value => $constraint_validation_expiration_time; diff --git a/manifests/db.pp b/manifests/db.pp index 8b9899ca..288d26ad 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -78,4 +78,7 @@ class heat::db ( include heat::db::sync } + # all db settings should be applied and all packages should be installed + # before dbsync starts + Oslo::Db['heat_config'] -> Anchor['heat::dbsync::begin'] } diff --git a/manifests/deps.pp b/manifests/deps.pp index 2645fd0d..457b2346 100644 --- a/manifests/deps.pp +++ b/manifests/deps.pp @@ -24,33 +24,17 @@ class heat::deps { ~> Service<| tag == 'heat-service' |> ~> anchor { 'heat::service::end': } - # paste-api.ini config should occur in the config block also. Anchor['heat::config::begin'] -> Heat_api_paste_ini<||> - ~> Anchor['heat::config::end'] - - # all cache settings should be applied and all packages should be installed - # before service startup - Oslo::Cache<||> -> Anchor['heat::service::begin'] - - # policy config should occur in the config block also. - Anchor['heat::config::begin'] - -> Openstacklib::Policy<| tag == 'heat' |> -> Anchor['heat::config::end'] - # On any uwsgi config change, we must restart Heat API. Anchor['heat::config::begin'] -> Heat_api_uwsgi_config<||> - ~> Anchor['heat::config::end'] + -> Anchor['heat::config::end'] - # On any uwsgi config change, we must restart Heat API CFN. Anchor['heat::config::begin'] -> Heat_api_cfn_uwsgi_config<||> - ~> Anchor['heat::config::end'] - - # all db settings should be applied and all packages should be installed - # before dbsync starts - Oslo::Db<||> -> Anchor['heat::dbsync::begin'] + -> Anchor['heat::config::end'] # Installation or config changes will always restart services. Anchor['heat::install::end'] ~> Anchor['heat::service::begin'] diff --git a/manifests/keystone/authtoken.pp b/manifests/keystone/authtoken.pp index 4bb1bcbb..e27fa45b 100644 --- a/manifests/keystone/authtoken.pp +++ b/manifests/keystone/authtoken.pp @@ -279,4 +279,6 @@ class heat::keystone::authtoken( service_type => $service_type, interface => $interface; } + + Keystone::Resource::Authtoken['heat_config'] -> Anchor['heat::config::end'] } diff --git a/manifests/policy.pp b/manifests/policy.pp index 03547df7..0de2e8c2 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -65,11 +65,15 @@ class heat::policy ( file_group => $::heat::params::group, file_format => 'yaml', purge_config => $purge_config, - tag => 'heat', } create_resources('openstacklib::policy', { $policy_path => $policy_parameters }) + # policy config should occur in the config block also. + Anchor['heat::config::begin'] + -> Openstacklib::Policy[$policy_path] + -> Anchor['heat::config::end'] + oslo::policy { 'heat_config': enforce_scope => $enforce_scope, enforce_new_defaults => $enforce_new_defaults, @@ -77,5 +81,4 @@ class heat::policy ( policy_default_rule => $policy_default_rule, policy_dirs => $policy_dirs, } - } diff --git a/spec/classes/heat_policy_spec.rb b/spec/classes/heat_policy_spec.rb index e8772f95..143ee0e8 100644 --- a/spec/classes/heat_policy_spec.rb +++ b/spec/classes/heat_policy_spec.rb @@ -33,7 +33,6 @@ describe 'heat::policy' do :file_group => 'heat', :file_format => 'yaml', :purge_config => false, - :tag => 'heat', ) is_expected.to contain_oslo__policy('heat_config').with( :enforce_scope => false, @@ -64,7 +63,6 @@ describe 'heat::policy' do :file_group => 'heat', :file_format => 'yaml', :purge_config => true, - :tag => 'heat', ) is_expected.to contain_oslo__policy('heat_config').with( :enforce_scope => false,