Re-execute necessary tasks on the deployed nodes

This change makes sure that Pacemaker and HAProxy are reconfigured
on the nodes that are already deployed when the environment is scaled
up. We use the 'update_required' stanza to enforce that the nodes
already deployed are updated in the same run than the new nodes. The
'reexecute_on' stanza doesn't guarantee that.

Change-Id: Id39a6246ee96a693c39898b84092710eb8a97536
Closes-Bug: #1536533
This commit is contained in:
Simon Pasquier 2016-01-21 16:54:33 +01:00
parent 2246dfe3c0
commit 835eddf24e
3 changed files with 20 additions and 13 deletions

View File

@ -18,17 +18,16 @@ $corosync_roles = hiera_array('lma::corosync_roles')
$network_metadata = hiera('network_metadata')
$nodes = get_nodes_hash_by_roles($network_metadata, $corosync_roles)
Cs_property {
provider => 'crm',
}
if count($nodes) > 2 {
$policy = 'stop'
} else {
$policy = 'ignore'
}
# The default provider ('pcs') fails to change the property's value so we have
# to force the use of 'crm'
cs_property { 'no-quorum-policy':
ensure => present,
value => $policy,
ensure => present,
value => $policy,
provider => 'crm',
}

View File

@ -34,7 +34,7 @@
strategy:
type: parallel
# This task needs to be reexecuted to recheck configuration
# This task needs to be reexecuted to recheck the configuration
- id: lma-es-check-configuration
type: puppet
groups: [primary-elasticsearch_kibana]
@ -144,13 +144,14 @@
reexecute_on:
- deploy_changes
# This task needs to be reexecuted to reconfigure the no-quorum-policy each
# time the cluster is scaled.
- id: lma-enable-quorum
# This task needs to be reexecuted to reconfigure the no-quorum-policy every
# time the cluster is scaled up or down. In case of scale up, it should happen
# after the new nodes have added themselves to the Pacemaker cluster.
- id: lma-es-kibana-enable-quorum
type: puppet
groups: [primary-elasticsearch_kibana]
requires: [lma-es-kibana-haproxy]
required_for: [deploy_end]
role: [primary-elasticsearch_kibana]
requires: [post_deployment_start]
required_for: [post_deployment_end]
parameters:
puppet_manifest: "puppet/manifests/enable_quorum.pp"
puppet_modules: "puppet/modules"

View File

@ -12,3 +12,10 @@ elasticsearch_kibana:
- compute
- cinder
- ceph-osd
# 'update_required' is needed to make sure that the already deployed nodes
# are updated in the same run as the new nodes. The 'reexecute_on' stanza
# doesn't guarantee this since the reexecuted tasks are run after the new
# nodes are deployed.
update_required:
- primary-elasticsearch_kibana
- elasticsearch_kibana