From 8d4873a3af5e515769c7b87ce5d36cc49b773707 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Sun, 25 Jun 2023 23:43:55 +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: I83d3ff31083dd687c5b2d76c8297b5e74a7caa1a --- manifests/deps.pp | 2 +- manifests/policy.pp | 1 + spec/classes/glance_policy_spec.rb | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/manifests/deps.pp b/manifests/deps.pp index c64bca2c..eda6cb2e 100644 --- a/manifests/deps.pp +++ b/manifests/deps.pp @@ -30,7 +30,7 @@ class glance::deps { # policy config should occur in the config block also. Anchor['glance::config::begin'] - -> Openstacklib::Policy<||> + -> Openstacklib::Policy<| tag == 'glance' |> ~> Anchor['glance::config::end'] # On any uwsgi config change, we must restart Glance API. diff --git a/manifests/policy.pp b/manifests/policy.pp index f16c6643..5f20c6ca 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -65,6 +65,7 @@ class glance::policy ( file_group => $::glance::params::group, file_format => 'yaml', purge_config => $purge_config, + tag => 'glance', } create_resources('openstacklib::policy', { $policy_path => $policy_parameters }) diff --git a/spec/classes/glance_policy_spec.rb b/spec/classes/glance_policy_spec.rb index b875b1ee..f5f96cc5 100644 --- a/spec/classes/glance_policy_spec.rb +++ b/spec/classes/glance_policy_spec.rb @@ -33,6 +33,7 @@ describe 'glance::policy' do :file_group => 'glance', :file_format => 'yaml', :purge_config => false, + :tag => 'glance', ) is_expected.to contain_oslo__policy('glance_api_config').with( :enforce_scope => false, @@ -63,6 +64,7 @@ describe 'glance::policy' do :file_group => 'glance', :file_format => 'yaml', :purge_config => true, + :tag => 'glance', ) is_expected.to contain_oslo__policy('glance_api_config').with( :enforce_scope => false,