Merge "Configure no-quorum-policy for Pacemaker"

This commit is contained in:
Jenkins 2016-01-28 10:52:33 +00:00 committed by Gerrit Code Review
commit f8d69a6e61
2 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,33 @@
# Copyright 2016 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
prepare_network_config(hiera('network_scheme', {}))
$corosync_roles = hiera_array('lma::corosync_roles')
$network_metadata = hiera('network_metadata')
$nodes = get_nodes_hash_by_roles($network_metadata, $corosync_roles)
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,
provider => 'crm',
}

View File

@ -67,3 +67,17 @@
puppet_manifest: "puppet/modules/osnailyfacter/modular/virtual_ips/virtual_ips.pp"
puppet_modules: "puppet/modules"
timeout: 600
# This task needs to be reexecuted to reconfigure the no-quorum-policy every
# time the cluster is scaled up or down
- id: lma-alerting-enable-quorum
type: puppet
role: [primary-infrastructure_alerting]
requires: [post_deployment_start]
required_for: [post_deployment_end]
parameters:
puppet_manifest: "puppet/manifests/enable_quorum.pp"
puppet_modules: "puppet/modules"
timeout: 120
reexecute_on:
- deploy_changes