From dabe1c7a8eac2d9f87fe2aa31abb7e5c7d555b4a Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Sun, 25 Jun 2023 23:40:39 +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: I7eda28c684af2def0d4acacfa5ba453ef02b42a3 (cherry picked from commit 2abda4f574fe9b152f45af67ddefe75b20459aa3) (cherry picked from commit 9ff18740fb82b0f8d45f153ec4fe13fc20ed1bcd) --- manifests/deps.pp | 2 +- manifests/policy.pp | 1 + spec/classes/cloudkitty_policy_spec.rb | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/manifests/deps.pp b/manifests/deps.pp index eb3dc5c..4b29910 100644 --- a/manifests/deps.pp +++ b/manifests/deps.pp @@ -41,7 +41,7 @@ class cloudkitty::deps { # policy config should occur in the config block also. Anchor['cloudkitty::config::begin'] - -> Openstacklib::Policy<||> + -> Openstacklib::Policy<| tag == 'cloudkitty' |> ~> Anchor['cloudkitty::config::end'] # On any uwsgi config change, we must restart Cloudkitty API. diff --git a/manifests/policy.pp b/manifests/policy.pp index a572323..b2183db 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -62,6 +62,7 @@ class cloudkitty::policy ( file_group => $::cloudkitty::params::group, file_format => 'yaml', purge_config => $purge_config, + tag => 'cloudkitty', } create_resources('openstacklib::policy', { $policy_path => $policy_parameters }) diff --git a/spec/classes/cloudkitty_policy_spec.rb b/spec/classes/cloudkitty_policy_spec.rb index 6844827..1c00af6 100644 --- a/spec/classes/cloudkitty_policy_spec.rb +++ b/spec/classes/cloudkitty_policy_spec.rb @@ -32,6 +32,7 @@ describe 'cloudkitty::policy' do :file_group => 'cloudkitty', :file_format => 'yaml', :purge_config => false, + :tag => 'cloudkitty', ) is_expected.to contain_oslo__policy('cloudkitty_config').with( :enforce_scope => false, @@ -61,6 +62,7 @@ describe 'cloudkitty::policy' do :file_group => 'cloudkitty', :file_format => 'yaml', :purge_config => true, + :tag => 'cloudkitty', ) is_expected.to contain_oslo__policy('cloudkitty_config').with( :enforce_scope => false,