summaryrefslogtreecommitdiffstats
path: root/puppet/manifests/overcloud_controller_pacemaker.pp
diff options
context:
space:
mode:
authorGiulio Fidente <gfidente@redhat.com>2015-05-18 10:57:55 -0400
committerGiulio Fidente <gfidente@redhat.com>2015-05-19 07:09:07 -0400
commite4165af938510ff1352b9657e1e3942f1803e0a7 (patch)
tree039fbaed11c17832742df7f5a93bc7f85e76c730 /puppet/manifests/overcloud_controller_pacemaker.pp
parent5f83a28bd43c85ff4355cbc33071c1eb97d3816e (diff)
Consolidate use of $pacemaker_master in step 2
Aims at having the Pacemaker resources configuration happening in a single if condition. Change-Id: I497538510f80a356e876d476024671b787b77fc9
Diffstat (limited to 'puppet/manifests/overcloud_controller_pacemaker.pp')
-rw-r--r--puppet/manifests/overcloud_controller_pacemaker.pp80
1 files changed, 31 insertions, 49 deletions
diff --git a/puppet/manifests/overcloud_controller_pacemaker.pp b/puppet/manifests/overcloud_controller_pacemaker.pp
index 4b956bfb..3966c037 100644
--- a/puppet/manifests/overcloud_controller_pacemaker.pp
+++ b/puppet/manifests/overcloud_controller_pacemaker.pp
@@ -31,8 +31,10 @@ if !str2bool(hiera('enable_package_install', 'false')) {
if $::hostname == downcase(hiera('bootstrap_nodeid')) {
$pacemaker_master = true
+ $sync_db = true
} else {
$pacemaker_master = false
+ $sync_db = false
}
if hiera('step') >= 1 {
@@ -159,18 +161,15 @@ if hiera('step') >= 2 {
pacemaker::resource::service { 'haproxy':
clone_params => true,
}
- }
-
- # MongoDB
- if downcase(hiera('ceilometer_backend')) == 'mongodb' {
- $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, ',')
- $mongodb_replset = hiera('mongodb::server::replset')
- $ceilometer_mongodb_conn_string = "mongodb://${mongo_node_string}/ceilometer?replicaSet=${mongodb_replset}"
- if downcase(hiera('bootstrap_nodeid')) == $::hostname {
+ pacemaker::resource::ocf { 'rabbitmq':
+ ocf_agent_name => 'heartbeat:rabbitmq-cluster',
+ resource_params => 'set_policy=\'ha-all ^(?!amq\.).* {"ha-mode":"all"}\'',
+ clone_params => true,
+ require => Class['::rabbitmq'],
+ }
+ if downcase(hiera('ceilometer_backend')) == 'mongodb' {
pacemaker::resource::service { $::mongodb::params::service_name :
op_params => 'start timeout=120s',
clone_params => true,
@@ -179,19 +178,35 @@ if hiera('step') >= 2 {
}
# NOTE (spredzy) : The replset can only be run
# once all the nodes have joined the cluster.
+ $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, ',')
+ $mongodb_replset = hiera('mongodb::server::replset')
$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,
+ require => Exec['mongodb-ready'],
}
}
+
+ pacemaker::resource::ocf { 'galera' :
+ ocf_agent_name => 'heartbeat:galera',
+ op_params => 'promote timeout=300s on-fail=block --master',
+ meta_params => "master-max=${galera_nodes_count} ordered=true",
+ resource_params => "additional_parameters='--open-files-limit=16384' enable_creation=true wsrep_cluster_address='gcomm://${galera_nodes}'",
+ require => Class['::mysql::server'],
+ before => Exec['galera-ready'],
+ }
+ mysql_user { 'clustercheckuser@localhost' :
+ password_hash => mysql_password($clustercheck_password),
+ require => Exec['galera-ready'],
+ }
}
# Redis
@@ -215,34 +230,12 @@ if hiera('step') >= 2 {
}
}
- # Galera
- if $pacemaker_master {
- $sync_db = true
-
- pacemaker::resource::ocf { 'galera' :
- ocf_agent_name => 'heartbeat:galera',
- op_params => 'promote timeout=300s on-fail=block --master',
- meta_params => "master-max=${galera_nodes_count} ordered=true",
- resource_params => "additional_parameters='--open-files-limit=16384' enable_creation=true wsrep_cluster_address='gcomm://${galera_nodes}'",
- require => Class['::mysql::server'],
- before => Exec['galera-ready'],
- }
-
- mysql_user { 'clustercheckuser@localhost' :
- password_hash => mysql_password($clustercheck_password),
- require => Exec['galera-ready'],
- }
- } else {
- $sync_db = false
- }
-
exec { 'galera-ready' :
command => '/bin/mysql -e "SHOW GLOBAL VARIABLES LIKE \'read_only\'" | /bin/grep -i off',
- timeout => 3600,
+ timeout => 600,
tries => 60,
- try_sleep => 60,
+ try_sleep => 10,
environment => 'HOME=/root',
- require => Class['::mysql::server'],
}
file { '/etc/sysconfig/clustercheck' :
@@ -266,7 +259,6 @@ MYSQL_HOST=localhost\n",
require => File['/etc/sysconfig/clustercheck'],
}
- # FIXME: this should only occur on the bootstrap host (ditto for db syncs)
# Create all the database schemas
# Example DSN format: mysql://user:password@host/dbname
if $sync_db {
@@ -338,16 +330,6 @@ MYSQL_HOST=localhost\n",
}
}
- # RabbitMQ
- if $pacemaker_master {
- pacemaker::resource::ocf { 'rabbitmq':
- ocf_agent_name => 'heartbeat:rabbitmq-cluster',
- resource_params => 'set_policy=\'ha-all ^(?!amq\.).* {"ha-mode":"all"}\'',
- clone_params => true,
- require => Class['::rabbitmq'],
- }
- }
-
# pre-install swift here so we can build rings
include ::swift
@@ -569,7 +551,7 @@ if (hiera('step') >= 3 and $pacemaker_master) or hiera('step') >= 4 {
$ceilometer_database_connection = hiera('ceilometer_mysql_conn_string')
}
default : {
- $ceilometer_database_connection = $ceilometer_mongodb_conn_string
+ $ceilometer_database_connection = "mongodb://${mongo_node_string}/ceilometer?replicaSet=${mongodb_replset}"
}
}
include ::ceilometer
@@ -616,4 +598,4 @@ if (hiera('step') >= 3 and $pacemaker_master) or hiera('step') >= 4 {
snmpd_config => [ join(['rouser ', hiera('snmpd_readonly_user_name')]), 'proc cron', 'includeAllDisks 10%', 'master agentx', 'trapsink localhost public', 'iquerySecName internalUser', 'rouser internalUser', 'defaultMonitors yes', 'linkUpDownNotifications yes' ],
}
-} #END STEP 3
+} #END STEP 3/4