d7c27f5051
If all policies get deleted, previously created policy files won't get removed and the api policy file is still used. Let's make sure the policy file gets purged if the policies hash is empty. Depends-On: https://review.opendev.org/802305 Change-Id: Ic9b5ccd8fc23f6cebc06f62d972b64efd2400396
46 lines
1.0 KiB
Puppet
46 lines
1.0 KiB
Puppet
# == Class: nova::metadata::novajoin::policy
|
|
#
|
|
# Configure the nova policies
|
|
#
|
|
# === Parameters
|
|
#
|
|
# [*policies*]
|
|
# (Optional) Set of policies to configure for novajoin
|
|
# Example :
|
|
# {
|
|
# 'novajoin-compute_service_user' => {
|
|
# 'key' => 'compute_service_user',
|
|
# 'value' => 'role:admin'
|
|
# }
|
|
# }
|
|
# Defaults to empty hash.
|
|
#
|
|
# [*policy_path*]
|
|
# (Optional) Path to the novajoin policy.yaml file
|
|
# Defaults to /etc/novajoin/policy.yaml
|
|
#
|
|
# [*purge_config*]
|
|
# (optional) Whether to set only the specified policy rules in the policy
|
|
# file.
|
|
# Defaults to false.
|
|
#
|
|
class nova::metadata::novajoin::policy (
|
|
$policies = {},
|
|
$policy_path = '/etc/novajoin/policy.yaml',
|
|
$purge_config = false,
|
|
) {
|
|
|
|
validate_legacy(Hash, 'validate_hash', $policies)
|
|
|
|
openstacklib::policy { $policy_path:
|
|
policies => $policies,
|
|
policy_path => $policy_path,
|
|
file_user => 'root',
|
|
file_format => 'yaml',
|
|
purge_config => $purge_config,
|
|
}
|
|
|
|
oslo::policy { 'novajoin_config': policy_file => $policy_path }
|
|
|
|
}
|