Add per module policy service refresh

Updating the policies for this project should only
refresh the services that reads it.

Change-Id: I5b7504bc02b2576a8921d1a70bc1bd07b19c1023
(cherry picked from commit fea62d44e9)
(cherry picked from commit 841e19d5a2)
(cherry picked from commit 28ee3ee9e7)
This commit is contained in:
Tobias Urdin 2023-06-25 23:44:45 +02:00
parent d47dda0b68
commit 2fdcd5616c
3 changed files with 4 additions and 1 deletions

View File

@ -35,7 +35,7 @@ class gnocchi::deps {
# policy config should occur in the config block also.
Anchor['gnocchi::config::begin']
-> Openstacklib::Policy<||>
-> Openstacklib::Policy<| tag == 'gnocchi' |>
~> Anchor['gnocchi::config::end']
# On any uwsgi config change, we must restart gnocchi-api.

View File

@ -75,6 +75,7 @@ class gnocchi::policy (
file_group => $::gnocchi::params::group,
file_format => 'yaml',
purge_config => $purge_config,
tag => 'gnocchi',
}
create_resources('openstacklib::policy', { $policy_path => $policy_parameters })

View File

@ -32,6 +32,7 @@ describe 'gnocchi::policy' do
:file_group => 'gnocchi',
:file_format => 'yaml',
:purge_config => false,
:tag => 'gnocchi',
)
is_expected.to contain_oslo__policy('gnocchi_config').with(
:enforce_scope => false,
@ -61,6 +62,7 @@ describe 'gnocchi::policy' do
:file_group => 'gnocchi',
:file_format => 'yaml',
:purge_config => true,
:tag => 'gnocchi',
)
is_expected.to contain_oslo__policy('gnocchi_config').with(
:enforce_scope => false,