Add per module policy service refresh

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

Change-Id: Ied6c7759af242021ed83e3c60197e74c947bf811
This commit is contained in:
Tobias Urdin 2023-06-25 23:52:14 +02:00
parent 33a84b2602
commit f42642bd61
3 changed files with 4 additions and 1 deletions

View File

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

View File

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

View File

@ -33,6 +33,7 @@ describe 'magnum::policy' do
:file_group => 'magnum', :file_group => 'magnum',
:file_format => 'yaml', :file_format => 'yaml',
:purge_config => false, :purge_config => false,
:tag => 'magnum',
) )
is_expected.to contain_oslo__policy('magnum_config').with( is_expected.to contain_oslo__policy('magnum_config').with(
:enforce_scope => false, :enforce_scope => false,
@ -63,6 +64,7 @@ describe 'magnum::policy' do
:file_group => 'magnum', :file_group => 'magnum',
:file_format => 'yaml', :file_format => 'yaml',
:purge_config => true, :purge_config => true,
:tag => 'magnum',
) )
is_expected.to contain_oslo__policy('magnum_config').with( is_expected.to contain_oslo__policy('magnum_config').with(
:enforce_scope => false, :enforce_scope => false,