Files
puppet-cloudkitty/manifests/policy.pp
Takashi Kajinami 3c8553a898 Use yaml instead of json for policy file
Because usage of json for policy file will be deprecated and replaced
by yaml[1].

[1] https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

Depends-on: https://review.opendev.org/769647
Change-Id: I4a3d5996beaaec649dbd076f29e80d6dc9705cbf
2021-01-07 23:18:16 +00:00

48 lines
1.1 KiB
Puppet

# == Class: cloudkitty::policy
#
# Configure the cloudkitty policies
#
# === Parameters
#
# [*policies*]
# (Optional) Set of policies to configure for cloudkitty
# Example :
# {
# 'cloudkitty-context_is_admin' => {
# 'key' => 'context_is_admin',
# 'value' => 'true'
# },
# 'cloudkitty-default' => {
# 'key' => 'default',
# 'value' => 'rule:admin_or_owner'
# }
# }
# Defaults to empty hash.
#
# [*policy_path*]
# (Optional) Path to the nova policy.yaml file
# Defaults to /etc/cloudkitty/policy.yaml
#
class cloudkitty::policy (
$policies = {},
$policy_path = '/etc/cloudkitty/policy.yaml',
) {
include cloudkitty::deps
include cloudkitty::params
validate_legacy(Hash, 'validate_hash', $policies)
Openstacklib::Policy::Base {
file_path => $policy_path,
file_user => 'root',
file_group => $::cloudkitty::params::group,
file_format => 'yaml',
}
create_resources('openstacklib::policy::base', $policies)
oslo::policy { 'cloudkitty_config': policy_file => $policy_path }
}