Delete policy file if policies hash is empty

If all policies get deleted, previously created policy files won't
get removed and the api policy file is still is used. Lets make
sure the policy file gets purged if the policies hash is empty.

Depends-On: https://review.opendev.org/c/openstack/puppet-openstacklib/+/802305
Change-Id: Ic9b5ccd8fc23f6cebc06f62d972b64efd2400396
This commit is contained in:
Martin Schuppert 2021-07-26 11:47:33 +02:00
parent 212ac22431
commit a9815f8b84
1 changed files with 8 additions and 7 deletions

View File

@ -49,15 +49,16 @@ class nova::policy (
validate_legacy(Hash, 'validate_hash', $policies)
Openstacklib::Policy::Base {
file_path => $policy_path,
file_user => 'root',
file_group => $::nova::params::group,
file_format => 'yaml',
class { '::openstacklib::policy':
policy_path => $policy_path,
policies => $policies,
file_mode => '0640',
file_user => 'root',
file_group => $::nova::params::group,
file_format => 'json',
purge_config => true,
}
create_resources('openstacklib::policy::base', $policies)
oslo::policy { 'nova_config':
enforce_scope => $enforce_scope,
enforce_new_defaults => $enforce_new_defaults,