Setup RabbitMQ before mcollective installation

* install RabbitMQ and create mcollective exchanges;
* restart mcollective service if config is changed;
* hearbeat for master node.

Thanks Dmitry Iliyn for helps.

Change-Id: I7b9006510d7fa747b3edf37ad724063cef122f3f
Closes-Bug: #1311530
This commit is contained in:
Vladimir Sharshov 2014-04-23 14:05:04 +04:00
parent 646e52b7a3
commit f44ea3885c
5 changed files with 17 additions and 3 deletions

View File

@ -55,6 +55,7 @@ class mcollective::server(
group => root,
mode => 0600,
require => Package[$mcollective_package],
notify => Service['mcollective'],
}
service { "mcollective":

View File

@ -31,6 +31,7 @@ plugin.rabbitmq.pool.1.host = <%= @host %>
plugin.rabbitmq.pool.1.port = <%= @stompport %>
plugin.rabbitmq.pool.1.user = <%= @user %>
plugin.rabbitmq.pool.1.password = <%= @password %>
plugin.rabbitmq.heartbeat_interval = 30
<% end -%>
# Facts

View File

@ -60,6 +60,7 @@ class nailgun(
Class["nailgun::user"] ->
Class["nailgun::logrotate"] ->
Class["nailgun::rabbitmq"] ->
Class["nailgun::mcollective"] ->
Class["nailgun::venv"] ->
Class["nailgun::astute"] ->
Class["nailgun::nginx-nailgun"] ->

View File

@ -7,6 +7,7 @@ class nailgun::mcollective(
$rabbitmq_host = "localhost",
){
anchor { 'nailgun::mcollective start' :} ->
class { "mcollective::client":
pskey => $mco_pskey,
vhost => $mco_vhost,
@ -14,7 +15,7 @@ class nailgun::mcollective(
password => $mco_password,
host => $rabbitmq_host,
stomp => false,
}
} ->
class { "mcollective::server":
pskey => $mco_pskey,
vhost => $mco_vhost,
@ -22,6 +23,7 @@ class nailgun::mcollective(
password => $mco_password,
host => $rabbitmq_host,
stomp => false,
}
} ->
anchor { 'nailgun::mcollective end' :}
}

View File

@ -11,6 +11,10 @@ class nailgun::rabbitmq (
$rabbitmq_host = "localhost",
) {
include stdlib
anchor { 'nailgun::rabbitmq start' :}
anchor { 'nailgun::rabbitmq end' :}
define access_to_rabbitmq_port ($port, $protocol = 'tcp') {
$rule = "-p $protocol -m state --state NEW -m $protocol --dport $port -j ACCEPT"
@ -125,4 +129,9 @@ class nailgun::rabbitmq (
stomp_port => $stompport,
node_ip_address => 'UNSET',
}
Anchor['nailgun::rabbitmq start'] ->
Class['rabbitmq::server'] ->
Anchor['nailgun::rabbitmq end']
}