summaryrefslogtreecommitdiffstats
path: root/puppet/manifests/overcloud_controller.pp
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-05-05 20:55:17 +0000
committerGerrit Code Review <review@openstack.org>2015-05-05 20:55:17 +0000
commit92377361c76a612457cc147a0608d94db430a771 (patch)
tree92040cbef598ca22d850e053d34960271ec0ab62 /puppet/manifests/overcloud_controller.pp
parent4e4c40376082197822d9cd64c09bee6cadf8067c (diff)
parent217f89eadb7f432f78c4a5c03a8b7c9cd237162d (diff)
Merge "Add MongoDB as a Pacemaker resource when EnablePacemaker"
Diffstat (limited to 'puppet/manifests/overcloud_controller.pp')
-rw-r--r--puppet/manifests/overcloud_controller.pp33
1 files changed, 32 insertions, 1 deletions
diff --git a/puppet/manifests/overcloud_controller.pp b/puppet/manifests/overcloud_controller.pp
index 7628f0a6..60790971 100644
--- a/puppet/manifests/overcloud_controller.pp
+++ b/puppet/manifests/overcloud_controller.pp
@@ -69,6 +69,8 @@ if hiera('step') >= 1 {
clone => true,
}
}
+
+ Class['::pacemaker::corosync'] -> Pacemaker::Resource::Systemd <| |>
}
}
@@ -82,7 +84,16 @@ if hiera('step') >= 2 {
# MongoDB
if downcase(hiera('ceilometer_backend')) == 'mongodb' {
include ::mongodb::globals
- include ::mongodb::server
+
+ if $enable_pacemaker {
+ $mongodb_service_ensure = undef
+ } else {
+ $mongodb_service_ensure = 'running'
+ }
+
+ class {'::mongodb::server' :
+ service_ensure => $mongodb_service_ensure,
+ }
$mongo_node_ips = split(hiera('mongo_node_ips'), ',')
$mongo_node_ips_with_port = suffix($mongo_node_ips, ':27017')
$mongo_node_string = join($mongo_node_ips_with_port, ',')
@@ -90,6 +101,26 @@ if hiera('step') >= 2 {
$mongodb_replset = hiera('mongodb::server::replset')
$ceilometer_mongodb_conn_string = "mongodb://${mongo_node_string}/ceilometer?replicaSet=${mongodb_replset}"
if downcase(hiera('bootstrap_nodeid')) == $::hostname {
+
+ if $enable_pacemaker {
+ pacemaker::resource::systemd { 'mongod' :
+ options => "op start timeout=120s",
+ clone => true,
+ before => Exec['mongodb-ready'],
+ }
+ # NOTE (spredzy) : The replset can only be run
+ # once all the nodes have joined the cluster.
+ $mongodb_cluster_ready_command = join(suffix(prefix($mongo_node_ips, '/bin/nc -w1 '), ' 27017 < /dev/null'), ' && ')
+ exec { 'mongodb-ready' :
+ command => $mongodb_cluster_ready_command,
+ timeout => 600,
+ tries => 60,
+ try_sleep => 10,
+ before => Mongodb_replset[$mongodb_replset],
+ }
+
+ }
+
mongodb_replset { $mongodb_replset :
members => $mongo_node_ips_with_port,
}