Add per module policy service refresh

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

Change-Id: I72b2d29962e82e9c254c2254663865da2b747e3b
This commit is contained in:
Tobias Urdin 2023-06-25 23:58:49 +02:00
parent cf3c3f6dbe
commit e2b1d99501
3 changed files with 4 additions and 1 deletions

View File

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

View File

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

View File

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