0673cafd6ff1b53843d19e8b478de09567145bfe
[mirror/dsa-puppet.git] / 3rdparty / modules / rabbitmq / lib / puppet / type / rabbitmq_erlang_cookie.rb
1 Puppet::Type.newtype(:rabbitmq_erlang_cookie) do
2   desc <<-DESC
3 Type to manage the rabbitmq erlang cookie securely
4
5 This is essentially a private type used by the rabbitmq::config class
6 to manage the erlang cookie. It replaces the rabbitmq_erlang_cookie fact
7 from earlier versions of this module. It manages the content of the cookie
8 usually located at "${rabbitmq_home}/.erlang.cookie", which includes
9 stopping the rabbitmq service and wiping out the database at
10 "${rabbitmq_home}/mnesia" if the user agrees to it. We don't recommend using
11 this type directly.
12 DESC
13
14   newparam(:path, namevar: true)
15
16   newproperty(:content) do
17     desc 'Content of cookie'
18     newvalues(%r{^\S+$})
19     def change_to_s(_current, _desired)
20       'The rabbitmq erlang cookie was changed'
21     end
22   end
23
24   newparam(:force) do
25     defaultto(:false)
26     newvalues(:true, :false)
27   end
28
29   newparam(:rabbitmq_user) do
30     defaultto('rabbitmq')
31   end
32
33   newparam(:rabbitmq_group) do
34     defaultto('rabbitmq')
35   end
36
37   newparam(:rabbitmq_home) do
38     defaultto('/var/lib/rabbitmq')
39   end
40
41   newparam(:service_name) do
42     newvalues(%r{^\S+$})
43   end
44 end