From e2b1d99501500991b2ddfd9cf115b33fbd2dc2ea Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Sun, 25 Jun 2023 23:58:49 +0200 Subject: [PATCH] Add per module policy service refresh Updating the policies for this project should only refresh the services that reads it. Change-Id: I72b2d29962e82e9c254c2254663865da2b747e3b --- manifests/deps.pp | 2 +- manifests/policy.pp | 1 + spec/classes/sahara_policy_spec.rb | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/manifests/deps.pp b/manifests/deps.pp index c664148f..c150a699 100644 --- a/manifests/deps.pp +++ b/manifests/deps.pp @@ -31,7 +31,7 @@ class sahara::deps { # policy config should occur in the config block also. Anchor['sahara::config::begin'] - -> Openstacklib::Policy<||> + -> Openstacklib::Policy<| tag == 'sahara' |> ~> Anchor['sahara::config::end'] # On any uwsgi config change, we must restart Sahara API. diff --git a/manifests/policy.pp b/manifests/policy.pp index 5e224ac8..51b4848e 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -65,6 +65,7 @@ class sahara::policy ( file_group => $::sahara::params::group, file_format => 'yaml', purge_config => $purge_config, + tag => 'sahara', } create_resources('openstacklib::policy', { $policy_path => $policy_parameters }) diff --git a/spec/classes/sahara_policy_spec.rb b/spec/classes/sahara_policy_spec.rb index df0e9650..08014484 100644 --- a/spec/classes/sahara_policy_spec.rb +++ b/spec/classes/sahara_policy_spec.rb @@ -33,6 +33,7 @@ describe 'sahara::policy' do :file_group => 'sahara', :file_format => 'yaml', :purge_config => false, + :tag => 'sahara', ) is_expected.to contain_oslo__policy('sahara_config').with( :enforce_scope => false, @@ -63,6 +64,7 @@ describe 'sahara::policy' do :file_group => 'sahara', :file_format => 'yaml', :purge_config => true, + :tag => 'sahara', ) is_expected.to contain_oslo__policy('sahara_config').with( :enforce_scope => false,