puppet-aodh/lib/puppet/type/aodh_config.rb
Emilien Macchi ca85542cc2 puppet-aodh: Initial commit
This is the initial commit for puppet-aodh.
It has been automatically generated using cookiecutter[1] and msync[2]

[1] https://github.com/openstack/puppet-openstack-cookiecutter
[2] https://github.com/openstack/puppet-modulesync-configs

Change-Id: I17611e8608931cf69b8d9891620e901a8936e19e
2015-10-01 09:35:49 -04:00

52 lines
1.1 KiB
Ruby

Puppet::Type.newtype(:aodh_config) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from aodh.conf'
newvalues(/\S+\/\S+/)
end
newproperty(:value) do
desc 'The value of the setting to be defined.'
munge do |value|
value = value.to_s.strip
value.capitalize! if value =~ /^(true|false)$/i
value
end
newvalues(/^[\S ]*$/)
def is_to_s( currentvalue )
if resource.secret?
return '[old secret redacted]'
else
return currentvalue
end
end
def should_to_s( newvalue )
if resource.secret?
return '[new secret redacted]'
else
return newvalue
end
end
end
newparam(:secret, :boolean => true) do
desc 'Whether to hide the value from Puppet logs. Defaults to `false`.'
newvalues(:true, :false)
defaultto false
end
newparam(:ensure_absent_val) do
desc 'A value that is specified as the value property will behave as if ensure => absent was specified'
defaultto('<SERVICE DEFAULT>')
end
autorequire(:package) do
'aodh'
end
end