From f42642bd61205cb8ed6968ae9cf2180eb772099a Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Sun, 25 Jun 2023 23:52:14 +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: Ied6c7759af242021ed83e3c60197e74c947bf811 --- manifests/deps.pp | 2 +- manifests/policy.pp | 1 + spec/classes/magnum_policy_spec.rb | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/manifests/deps.pp b/manifests/deps.pp index 1c6c510..47e7718 100644 --- a/manifests/deps.pp +++ b/manifests/deps.pp @@ -30,7 +30,7 @@ class magnum::deps { # policy config should occur in the config block also. Anchor['magnum::config::begin'] - -> Openstacklib::Policy<||> + -> Openstacklib::Policy<| tag == 'magnum' |> ~> Anchor['magnum::config::end'] # On any uwsgi config change, we must restart Magnum API. diff --git a/manifests/policy.pp b/manifests/policy.pp index b20093e..62cea9a 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -65,6 +65,7 @@ class magnum::policy ( file_group => $::magnum::params::group, file_format => 'yaml', purge_config => $purge_config, + tag => 'magnum', } create_resources('openstacklib::policy', { $policy_path => $policy_parameters }) diff --git a/spec/classes/magnum_policy_spec.rb b/spec/classes/magnum_policy_spec.rb index b258b58..2ba4e69 100644 --- a/spec/classes/magnum_policy_spec.rb +++ b/spec/classes/magnum_policy_spec.rb @@ -33,6 +33,7 @@ describe 'magnum::policy' do :file_group => 'magnum', :file_format => 'yaml', :purge_config => false, + :tag => 'magnum', ) is_expected.to contain_oslo__policy('magnum_config').with( :enforce_scope => false, @@ -63,6 +64,7 @@ describe 'magnum::policy' do :file_group => 'magnum', :file_format => 'yaml', :purge_config => true, + :tag => 'magnum', ) is_expected.to contain_oslo__policy('magnum_config').with( :enforce_scope => false,