From dbd8e47e31b25a0bf2422f3d523468a45549b0c3 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Sun, 25 Jun 2023 23:37:54 +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: I42153ec891feb569a9614166104be5382d893f96 (cherry picked from commit c38323518bbff0395b16c00a1a4640aba2231cef) --- manifests/deps.pp | 2 +- manifests/policy.pp | 1 + spec/classes/barbican_policy_spec.rb | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/manifests/deps.pp b/manifests/deps.pp index 519f98c6..f15dba0f 100644 --- a/manifests/deps.pp +++ b/manifests/deps.pp @@ -30,7 +30,7 @@ class barbican::deps { # policy config should occur in the config block also. Anchor['barbican::config::begin'] - -> Openstacklib::Policy<||> + -> Openstacklib::Policy<| tag == 'barbican' |> ~> Anchor['barbican::config::end'] # barbican-api-paste.ini config should occur in the config block also. diff --git a/manifests/policy.pp b/manifests/policy.pp index 0e561d86..aa24e188 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -67,6 +67,7 @@ class barbican::policy ( file_group => $::barbican::params::group, file_format => 'yaml', purge_config => $purge_config, + tag => 'barbican', } create_resources('openstacklib::policy', { $policy_path => $policy_parameters }) diff --git a/spec/classes/barbican_policy_spec.rb b/spec/classes/barbican_policy_spec.rb index b115db57..f047ef7c 100644 --- a/spec/classes/barbican_policy_spec.rb +++ b/spec/classes/barbican_policy_spec.rb @@ -33,6 +33,7 @@ describe 'barbican::policy' do :file_group => 'barbican', :file_format => 'yaml', :purge_config => false, + :tag => 'barbican', ) is_expected.to contain_oslo__policy('barbican_config').with( :enforce_scope => false, @@ -63,6 +64,7 @@ describe 'barbican::policy' do :file_group => 'barbican', :file_format => 'yaml', :purge_config => true, + :tag => 'barbican', ) is_expected.to contain_oslo__policy('barbican_config').with( :enforce_scope => false,