Add per module policy service refresh

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

Change-Id: I18418bb01da896f0e12aead11c28b24c0e103c62
This commit is contained in:
Tobias Urdin 2023-06-22 21:07:44 +02:00
parent 3a05a4aa6b
commit dea64e7fd3
3 changed files with 4 additions and 1 deletions

View File

@ -33,7 +33,7 @@ class {{cookiecutter.project_name}}::deps {
# policy config should occur in the config block also.
Anchor['{{cookiecutter.project_name}}::config::begin']
-> Openstacklib::Policy<||>
-> Openstacklib::Policy<| tag == '{{cookiecutter.project_name}}' |>
~> Anchor['{{cookiecutter.project_name}}::config::end']
# Installation or config changes will always restart services.

View File

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

View File

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