Skip to content

Commit

Permalink
Add rabbitmq_home, rabbitmq_user and rabbitmq_group to rabbitmq_erlan…
Browse files Browse the repository at this point in the history
…g_cookie

And pass them in config.pp when it is used.

Document the rabbitmq_home, rabbitmq_user and rabbitmq_group
parameters in README.md
  • Loading branch information
buzzdeee committed Feb 22, 2015
1 parent 121771b commit 1e685b4
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 7 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,18 @@ repository otherwise.

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

####`rabbitmq_user`

String: OS dependent, default defined in param.pp. The system user the rabbitmq daemon runs as.

####`rabbitmq_group`

String: OS dependent, default defined in param.pp. The system group the rabbitmq daemon runs as.

####`rabbitmq_home`

String: OS dependent. default defined in param.pp. The home directory of the rabbitmq deamon.

##Native Types

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

##Limitations
Expand Down
12 changes: 12 additions & 0 deletions lib/puppet/type/rabbitmq_erlang_cookie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ def change_to_s(current, desired)
newvalues(:true, :false)
end

newparam(:rabbitmq_user) do
defaultto('rabbitmq')
end

newparam(:rabbitmq_group) do
defaultto('rabbitmq')
end

newparam(:rabbitmq_home) do
defaultto('/var/lib/rabbitmq')
end

newparam(:service_name) do
newvalues(/^\S+$/)
end
Expand Down
15 changes: 10 additions & 5 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
$management_port = $rabbitmq::management_port
$node_ip_address = $rabbitmq::node_ip_address
$plugin_dir = $rabbitmq::plugin_dir
$rabbitmq_user = $rabbitmq::rabbitmq_user
$rabbitmq_group = $rabbitmq::rabbitmq_group
$rabbitmq_home = $rabbitmq::rabbitmq_home
$port = $rabbitmq::port
$tcp_keepalive = $rabbitmq::tcp_keepalive
Expand Down Expand Up @@ -102,11 +104,14 @@
fail('You must set the $erlang_cookie value in order to configure clustering.')
} else {
rabbitmq_erlang_cookie { "${rabbitmq_home}/.erlang.cookie":
content => $erlang_cookie,
force => $wipe_db_on_cookie_change,
service_name => $service_name,
before => File['rabbitmq.config'],
notify => Class['rabbitmq::service'],
content => $erlang_cookie,
force => $wipe_db_on_cookie_change,
rabbitmq_user => $rabbitmq_user,
rabbitmq_group => $rabbitmq_group,
rabbitmq_home => $rabbitmq_home,
service_name => $service_name,
before => File['rabbitmq.config'],
notify => Class['rabbitmq::service'],
}
}
}
Expand Down

0 comments on commit 1e685b4

Please sign in to comment.