puppet-zaqar/manifests/policy.pp
Alex Schultz bdd660ccdb Add group to policy management
The move of policy.json into code means the file may not exist. We've
added support to ensure that the file exists in the openstacklib but we
need to make sure the permissions are right for each service. This adds
the group information to the policies so it works right.

Depends-On: I26e8b1384f4f69712da9d06a4c565dfd1f17c9ed
Related-Bug: #1742154
Change-Id: I10b322d05042fdef23758d46906cf57aa9def97f
2018-01-12 05:12:01 +00:00

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 }
}