diff options
author | Jenkins <jenkins@review.openstack.org> | 2015-04-29 14:13:10 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2015-04-29 14:13:10 +0000 |
commit | d3ad26e0ecf6634d0437235abd89f9f0d282d020 (patch) | |
tree | b382917b04d7edfe64bcb3fec94bff5807d2cf5f /puppet/manifests | |
parent | c3144c9bf6ec39b6832845fdd41ecb4832ac6ed4 (diff) | |
parent | 1d0eb73c13ee5179f0eecb87754bc9deb952da1c (diff) |
Merge "Add RabbitMQ as a Pacemaker resource when EnablePacemaker"
Diffstat (limited to 'puppet/manifests')
-rw-r--r-- | puppet/manifests/overcloud_controller.pp | 74 |
1 files changed, 46 insertions, 28 deletions
diff --git a/puppet/manifests/overcloud_controller.pp b/puppet/manifests/overcloud_controller.pp index 7d36bb33..7e7f2fb2 100644 --- a/puppet/manifests/overcloud_controller.pp +++ b/puppet/manifests/overcloud_controller.pp @@ -24,11 +24,17 @@ if !str2bool(hiera('enable_package_install', 'false')) { } } +$enable_pacemaker = str2bool(hiera('enable_pacemaker')) +$enable_keepalived = !$enable_pacemaker +if $::hostname == downcase(hiera('bootstrap_nodeid')) { + $pacemaker_master = true +} else { + $pacemaker_master = false +} + if hiera('step') >= 1 { $controller_node_ips = split(hiera('controller_node_ips'), ',') - $enable_pacemaker = str2bool(hiera('enable_pacemaker')) - $enable_keepalived = !$enable_pacemaker class { '::tripleo::loadbalancer' : controller_hosts => $controller_node_ips, @@ -37,11 +43,6 @@ if hiera('step') >= 1 { if $enable_pacemaker { $pacemaker_cluster_members = regsubst(hiera('controller_node_ips'), ',', ' ', 'G') - if $::hostname == downcase(hiera('bootstrap_nodeid')) { - $pacemaker_master = true - } else { - $pacemaker_master = false - } user { 'hacluster': ensure => present, } -> @@ -182,29 +183,46 @@ if hiera('step') >= 2 { allowed_hosts => $allowed_hosts, } - $rabbit_nodes = split(downcase(hiera('rabbit_node_names', $::hostname)), ',') - if count($rabbit_nodes) > 1 { - $rabbit_cluster = true - } - else { - $rabbit_cluster = false - } - class { 'rabbitmq': - config_cluster => $rabbit_cluster, - cluster_nodes => $rabbit_nodes, - node_ip_address => hiera('controller_host'), - } - if $rabbit_cluster { - rabbitmq_policy { 'ha-all@/': - pattern => '^(?!amq\.).*', - definition => { - 'ha-mode' => 'all', - 'ha-sync-mode' => 'automatic', + if $enable_pacemaker { + # the module ignores erlang_cookie if cluster_config is false + file { '/var/lib/rabbitmq/.erlang.cookie': + ensure => 'present', + owner => 'rabbitmq', + group => 'rabbitmq', + mode => '0400', + content => hiera('rabbitmq::erlang_cookie'), + replace => true, + } -> + class { '::rabbitmq': + service_manage => false, + environment_variables => { + 'RABBITMQ_NODENAME' => "rabbit@$::hostname", }, } - } - rabbitmq_vhost { '/': - provider => 'rabbitmqctl', + if $pacemaker_master { + pacemaker::resource::ocf { 'rabbitmq': + resource_name => 'heartbeat:rabbitmq-cluster', + options => 'set_policy=\'ha-all ^(?!amq\.).* {"ha-mode":"all"}\'', + clone => true, + require => Class['::rabbitmq'], + } + } + } else { + $rabbit_nodes = split(hiera('rabbit_node_ips'), ',') + if count($rabbit_nodes) > 1 { + class { '::rabbitmq': + config_cluster => true, + cluster_nodes => $rabbit_nodes, + } + rabbitmq_policy { 'ha-all@/': + pattern => '^(?!amq\.).*', + definition => { + 'ha-mode' => 'all', + }, + } + } else { + include ::rabbitmq + } } # pre-install swift here so we can build rings |