dc4aae5fc6
Make sure documentation is the same and follow the standard which we are trying to enforce on all modules. Change-Id: I04fb9ead983cc8f7df40093b6404cac15cc9ac07
47 lines
980 B
Puppet
47 lines
980 B
Puppet
# == Class: zaqar::policy
|
|
#
|
|
# Configure the zaqar policies
|
|
#
|
|
# === Parameters
|
|
#
|
|
# [*policies*]
|
|
# (Optional) Set of policies to configure for zaqar
|
|
# Example :
|
|
# {
|
|
# 'zaqar-context_is_admin' => {
|
|
# 'key' => 'context_is_admin',
|
|
# 'value' => 'true'
|
|
# },
|
|
# 'zaqar-default' => {
|
|
# 'key' => 'default',
|
|
# 'value' => 'rule:admin_or_owner'
|
|
# }
|
|
# }
|
|
# Defaults to empty hash.
|
|
#
|
|
# [*policy_path*]
|
|
# (Optional) Path to the zaqar policy.json file
|
|
# Defaults to /etc/zaqar/policy.json
|
|
#
|
|
class zaqar::policy (
|
|
$policies = {},
|
|
$policy_path = '/etc/zaqar/policy.json',
|
|
) {
|
|
|
|
include ::zaqar::deps
|
|
include ::zaqar::params
|
|
|
|
validate_hash($policies)
|
|
|
|
Openstacklib::Policy::Base {
|
|
file_path => $policy_path,
|
|
file_user => 'root',
|
|
file_group => $::zaqar::params::group,
|
|
}
|
|
|
|
create_resources('openstacklib::policy::base', $policies)
|
|
|
|
oslo::policy { 'zaqar_config': policy_file => $policy_path }
|
|
|
|
}
|