Skip to content

Commit 1e685b4

Browse files
committed
Add rabbitmq_home, rabbitmq_user and rabbitmq_group to rabbitmq_erlang_cookie
And pass them in config.pp when it is used. Document the rabbitmq_home, rabbitmq_user and rabbitmq_group parameters in README.md
1 parent 121771b commit 1e685b4

File tree

3 files changed

+36
-7
lines changed

3 files changed

+36
-7
lines changed

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,18 @@ repository otherwise.
381381

382382
Boolean to determine if we should DESTROY AND DELETE the RabbitMQ database.
383383

384+
####`rabbitmq_user`
385+
386+
String: OS dependent, default defined in param.pp. The system user the rabbitmq daemon runs as.
387+
388+
####`rabbitmq_group`
389+
390+
String: OS dependent, default defined in param.pp. The system group the rabbitmq daemon runs as.
391+
392+
####`rabbitmq_home`
393+
394+
String: OS dependent. default defined in param.pp. The home directory of the rabbitmq deamon.
395+
384396
##Native Types
385397

386398
### rabbitmq\_user
@@ -493,9 +505,9 @@ rabbitmq_plugin {'rabbitmq_stomp':
493505
This is essentially a private type used by the rabbitmq::config class
494506
to manage the erlang cookie. It replaces the rabbitmq_erlang_cookie fact
495507
from earlier versions of this module. It manages the content of the cookie
496-
usually located at /var/lib/rabbitmq/.erlang.cookie, which includes
508+
usually located at "${rabbitmq_home}/.erlang.cookie", which includes
497509
stopping the rabbitmq service and wiping out the database at
498-
/var/lib/rabbitmq/mnesia if the user agrees to it. We don't recommend using
510+
"${rabbitmq_home}/mnesia" if the user agrees to it. We don't recommend using
499511
this type directly.
500512

501513
##Limitations

lib/puppet/type/rabbitmq_erlang_cookie.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ def change_to_s(current, desired)
1616
newvalues(:true, :false)
1717
end
1818

19+
newparam(:rabbitmq_user) do
20+
defaultto('rabbitmq')
21+
end
22+
23+
newparam(:rabbitmq_group) do
24+
defaultto('rabbitmq')
25+
end
26+
27+
newparam(:rabbitmq_home) do
28+
defaultto('/var/lib/rabbitmq')
29+
end
30+
1931
newparam(:service_name) do
2032
newvalues(/^\S+$/)
2133
end

manifests/config.pp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
$management_port = $rabbitmq::management_port
1919
$node_ip_address = $rabbitmq::node_ip_address
2020
$plugin_dir = $rabbitmq::plugin_dir
21+
$rabbitmq_user = $rabbitmq::rabbitmq_user
22+
$rabbitmq_group = $rabbitmq::rabbitmq_group
2123
$rabbitmq_home = $rabbitmq::rabbitmq_home
2224
$port = $rabbitmq::port
2325
$tcp_keepalive = $rabbitmq::tcp_keepalive
@@ -102,11 +104,14 @@
102104
fail('You must set the $erlang_cookie value in order to configure clustering.')
103105
} else {
104106
rabbitmq_erlang_cookie { "${rabbitmq_home}/.erlang.cookie":
105-
content => $erlang_cookie,
106-
force => $wipe_db_on_cookie_change,
107-
service_name => $service_name,
108-
before => File['rabbitmq.config'],
109-
notify => Class['rabbitmq::service'],
107+
content => $erlang_cookie,
108+
force => $wipe_db_on_cookie_change,
109+
rabbitmq_user => $rabbitmq_user,
110+
rabbitmq_group => $rabbitmq_group,
111+
rabbitmq_home => $rabbitmq_home,
112+
service_name => $service_name,
113+
before => File['rabbitmq.config'],
114+
notify => Class['rabbitmq::service'],
110115
}
111116
}
112117
}

0 commit comments

Comments
 (0)