From 11e694b010b26dd1b9065f52b759366dc24ca7b8 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Sun, 25 Jun 2023 23:57:58 +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: Iaf0bae66224d568a2a05f4ac5281c36bde2705e0 --- manifests/deps.pp | 2 +- manifests/policy.pp | 1 + spec/classes/placement_policy_spec.rb | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/manifests/deps.pp b/manifests/deps.pp index 63480aa..1573df7 100644 --- a/manifests/deps.pp +++ b/manifests/deps.pp @@ -41,7 +41,7 @@ class placement::deps { # policy config should occur in the config block also. Anchor['placement::config::begin'] - -> Openstacklib::Policy<||> + -> Openstacklib::Policy<| tag == 'placement' |> ~> Anchor['placement::config::end'] # On any uwsgi config change, we must restart Placement. diff --git a/manifests/policy.pp b/manifests/policy.pp index 77e77c8..087211e 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -65,6 +65,7 @@ class placement::policy ( file_group => $::placement::params::group, file_format => 'yaml', purge_config => $purge_config, + tag => 'placement', } create_resources('openstacklib::policy', { $policy_path => $policy_parameters }) diff --git a/spec/classes/placement_policy_spec.rb b/spec/classes/placement_policy_spec.rb index 9f3dd3c..ed091c0 100644 --- a/spec/classes/placement_policy_spec.rb +++ b/spec/classes/placement_policy_spec.rb @@ -33,6 +33,7 @@ describe 'placement::policy' do :file_group => 'placement', :file_format => 'yaml', :purge_config => false, + :tag => 'placement', ) is_expected.to contain_oslo__policy('placement_config').with( :enforce_scope => false, @@ -63,6 +64,7 @@ describe 'placement::policy' do :file_group => 'placement', :file_format => 'yaml', :purge_config => true, + :tag => 'placement', ) is_expected.to contain_oslo__policy('placement_config').with( :enforce_scope => false,