File: rabbitmq_plugin.rb

package info (click to toggle)
puppet-module-puppetlabs-rabbitmq 8.5.0-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,192 kB
  • sloc: ruby: 5,227; sh: 10; makefile: 4
file content (37 lines) | stat: -rw-r--r-- 842 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Puppet::Type.newtype(:rabbitmq_plugin) do
  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)
    newvalue(:present) do
      provider.create
    end
    newvalue(:absent) do
      provider.destroy
    end
  end

  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