From d6f55e497f1d455c357c32cbc3a879addb778739 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Sun, 25 Jun 2023 23:54:06 +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: I5a30077b83dacc901bbad38ecf58095780a7233d --- manifests/deps.pp | 2 +- manifests/policy.pp | 1 + spec/classes/mistral_policy_spec.rb | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/manifests/deps.pp b/manifests/deps.pp index b4da704..d0d9f9b 100644 --- a/manifests/deps.pp +++ b/manifests/deps.pp @@ -34,7 +34,7 @@ class mistral::deps { # policy config should occur in the config block Anchor['mistral::config::begin'] - -> Openstacklib::Policy<||> + -> Openstacklib::Policy<| tag == 'mistral' |> ~> Anchor['mistral::config::end'] # Installation or config changes will always restart services. diff --git a/manifests/policy.pp b/manifests/policy.pp index f39c9b4..b93bbd9 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -65,6 +65,7 @@ class mistral::policy ( file_group => $::mistral::params::group, file_format => 'yaml', purge_config => $purge_config, + tag => 'mistral', } create_resources('openstacklib::policy', { $policy_path => $policy_parameters }) diff --git a/spec/classes/mistral_policy_spec.rb b/spec/classes/mistral_policy_spec.rb index a54e116..27023b1 100644 --- a/spec/classes/mistral_policy_spec.rb +++ b/spec/classes/mistral_policy_spec.rb @@ -33,6 +33,7 @@ describe 'mistral::policy' do :file_group => 'mistral', :file_format => 'yaml', :purge_config => false, + :tag => 'mistral', ) is_expected.to contain_oslo__policy('mistral_config').with( :enforce_scope => false, @@ -63,6 +64,7 @@ describe 'mistral::policy' do :file_group => 'mistral', :file_format => 'yaml', :purge_config => true, + :tag => 'mistral', ) is_expected.to contain_oslo__policy('mistral_config').with( :enforce_scope => false,