From 835eddf24e18db43450860bbfcc17f5a8857c600 Mon Sep 17 00:00:00 2001 From: Simon Pasquier Date: Thu, 21 Jan 2016 16:54:33 +0100 Subject: [PATCH] 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 --- .../puppet/manifests/enable_quorum.pp | 11 +++++------ deployment_tasks.yaml | 15 ++++++++------- node_roles.yaml | 7 +++++++ 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/deployment_scripts/puppet/manifests/enable_quorum.pp b/deployment_scripts/puppet/manifests/enable_quorum.pp index e8867dd..b6ba3f6 100644 --- a/deployment_scripts/puppet/manifests/enable_quorum.pp +++ b/deployment_scripts/puppet/manifests/enable_quorum.pp @@ -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', } diff --git a/deployment_tasks.yaml b/deployment_tasks.yaml index 0ebbcc1..11954e5 100644 --- a/deployment_tasks.yaml +++ b/deployment_tasks.yaml @@ -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" diff --git a/node_roles.yaml b/node_roles.yaml index a4c4ce9..c75e7c3 100644 --- a/node_roles.yaml +++ b/node_roles.yaml @@ -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