X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Frabbitmq%2Flib%2Fpuppet%2Ftype%2Frabbitmq_plugin.rb;fp=3rdparty%2Fmodules%2Frabbitmq%2Flib%2Fpuppet%2Ftype%2Frabbitmq_plugin.rb;h=2cb96c5fae3e9fdda1714d0676d55415f419af4d;hb=94a8783f522bbf2996cb8a59b977dea583e8b0c7;hp=497ced4e6b5806e3e6d4243b25c31bc0ebc6ca95;hpb=e107504bce7d9b21cc301124fc7c39fdb0762374;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/rabbitmq/lib/puppet/type/rabbitmq_plugin.rb b/3rdparty/modules/rabbitmq/lib/puppet/type/rabbitmq_plugin.rb index 497ced4e6..2cb96c5fa 100644 --- a/3rdparty/modules/rabbitmq/lib/puppet/type/rabbitmq_plugin.rb +++ b/3rdparty/modules/rabbitmq/lib/puppet/type/rabbitmq_plugin.rb @@ -1,5 +1,15 @@ Puppet::Type.newtype(:rabbitmq_plugin) do - desc 'manages rabbitmq plugins' + desc <<-DESC +manages rabbitmq plugins + +@example query all currently enabled plugins + $ puppet resource rabbitmq_plugin + +@example Ensure a rabbitmq_plugin resource + rabbitmq_plugin {'rabbitmq_stomp': + ensure => present, + } +DESC ensurable do defaultto(:present) @@ -11,9 +21,17 @@ Puppet::Type.newtype(:rabbitmq_plugin) do end end - newparam(:name, :namevar => true) do - 'name of the plugin to enable' - newvalues(/^\S+$/) + newparam(:name, namevar: true) do + desc 'The name of the plugin to enable' + newvalues(%r{^\S+$}) end + newparam(:umask) do + desc 'Sets the octal umask to be used while creating this resource' + defaultto '0022' + munge do |value| + raise Puppet::Error, "The umask specification is invalid: #{value.inspect}" unless value =~ %r{^0?[0-7]{1,3}$} + return value.to_i(8) + end + end end