puppet-nova/manifests/metadata/novajoin/policy.pp
Steve Baker adc83318c9 New class nova::metadata::novajoin::policy
This allows novajoin policy overrides to be written to
/etc/novajoin/policy.json, just as nova::policy does for
/etc/nova/policy.json.

Change-Id: I8b2b60164314ce92b0df1a648f1356290576047a
Blueprint: nova-less-deploy
2019-09-30 23:31:52 +00:00

39 lines
877 B
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.json file
# Defaults to /etc/novajoin/policy.json
#
class nova::metadata::novajoin::policy (
$policies = {},
$policy_path = '/etc/novajoin/policy.json',
) {
validate_legacy(Hash, 'validate_hash', $policies)
$policy_defaults = {
file_path => $policy_path,
file_user => 'root',
}
create_resources('openstacklib::policy::base', $policies, $policy_defaults)
oslo::policy { 'novajoin_config': policy_file => $policy_path }
}