Files
puppet-openstacklib/manifests/policy/base.pp
Yanis Guenane 37935472f1 policy.json: Allow puppet modules to manage policy.json
Currently puppet modules does not allow one to manage policy.json.
This commit aims to create a common resource for people to manage
their policies.

Change-Id: I1cd7765cdcbddb7e7ad5d720f1efa382641712f2
2014-09-25 08:42:18 -04:00

32 lines
647 B
Puppet

# == Definition: openstacklib::policy::base
#
# This resource configures the policy.json file for an OpenStack service
#
# == Parameters:
#
# [*file_path*]
# Path to the policy.json file
# string; required
#
# [*key*]
# The key to replace the value for
# string; required; the key to replace the value for
#
# [*value*]
# The value to set
# string; optional; the value to set
#
define openstacklib::policy::base (
$file_path,
$key,
$value = '',
) {
augeas { "${file_path}-${key}-${value}" :
lens => 'Json.lns',
incl => $file_path,
changes => "set dict/entry[*][.=\"${key}\"]/string ${value}"
}
}