From dea64e7fd3aa73a7efb34d9db6d37e298a84c61f Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Thu, 22 Jun 2023 21:07:44 +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: I18418bb01da896f0e12aead11c28b24c0e103c62 --- puppet-{{cookiecutter.project_name}}/manifests/deps.pp | 2 +- puppet-{{cookiecutter.project_name}}/manifests/policy.pp | 1 + .../spec/classes/{{cookiecutter.project_name}}_policy_spec.rb | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/puppet-{{cookiecutter.project_name}}/manifests/deps.pp b/puppet-{{cookiecutter.project_name}}/manifests/deps.pp index 1f88218..0f2ecbd 100644 --- a/puppet-{{cookiecutter.project_name}}/manifests/deps.pp +++ b/puppet-{{cookiecutter.project_name}}/manifests/deps.pp @@ -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. diff --git a/puppet-{{cookiecutter.project_name}}/manifests/policy.pp b/puppet-{{cookiecutter.project_name}}/manifests/policy.pp index 5263719..e02092f 100644 --- a/puppet-{{cookiecutter.project_name}}/manifests/policy.pp +++ b/puppet-{{cookiecutter.project_name}}/manifests/policy.pp @@ -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 }) diff --git a/puppet-{{cookiecutter.project_name}}/spec/classes/{{cookiecutter.project_name}}_policy_spec.rb b/puppet-{{cookiecutter.project_name}}/spec/classes/{{cookiecutter.project_name}}_policy_spec.rb index 5ac75de..d960121 100644 --- a/puppet-{{cookiecutter.project_name}}/spec/classes/{{cookiecutter.project_name}}_policy_spec.rb +++ b/puppet-{{cookiecutter.project_name}}/spec/classes/{{cookiecutter.project_name}}_policy_spec.rb @@ -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,