Configure no-quorum-policy for Pacemaker
This change makes sure that the no-quorum-policy parameter is 'stop' when there are at least 3 nodes and 'ignore' otherwise. Change-Id: If65beaa9dbff0f52b3b369d9763d8b52ff110bfd
This commit is contained in:
parent
5f3a4a8ce0
commit
8ffd7c02a5
|
@ -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',
|
||||
}
|
|
@ -92,3 +92,16 @@
|
|||
# reexecute_on is needed for scale-down operations
|
||||
reexecute_on:
|
||||
- deploy_changes
|
||||
|
||||
- id: influxdb-enable-quorum
|
||||
type: puppet
|
||||
role: [primary-influxdb_grafana]
|
||||
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 is needed for scale-down operations
|
||||
reexecute_on:
|
||||
- deploy_changes
|
||||
|
|
Loading…
Reference in New Issue