Fix corosync_nodes usage

In Fuel 9.0 corosync module interface has been changed. We need to
adjust our modules accordingly.

Change-Id: If40e96a7807edc13a4d7e8cdfb3a37fa643edf23
This commit is contained in:
Guillaume Thouvenin 2016-04-01 15:12:21 +02:00
parent 78178faae9
commit ba2c4eaf6b
2 changed files with 31 additions and 10 deletions

View File

@ -16,6 +16,7 @@
# supports the use case where the Pacemaker cluster is made of several
# unrelated roles.
prepare_network_config(hiera_hash('network_scheme'))
$fuel_version = 0 + hiera('fuel_version')
$corosync_nodes = corosync_nodes(
get_nodes_hash_by_roles(
@ -26,10 +27,22 @@ $corosync_nodes = corosync_nodes(
)
$cluster_recheck_interval = hiera('cluster_recheck_interval', '190s')
class { 'cluster':
internal_address => get_network_role_property('mgmt/corosync', 'ipaddr'),
corosync_nodes => $corosync_nodes,
cluster_recheck_interval => $cluster_recheck_interval,
if $fuel_version < 9.0 {
class { '::cluster':
internal_address => get_network_role_property('mgmt/corosync', 'ipaddr'),
corosync_nodes => $corosync_nodes,
cluster_recheck_interval => $cluster_recheck_interval,
}
} else {
$corosync_nodes_processed = corosync_nodes_process($corosync_nodes)
class { '::cluster':
internal_address => get_network_role_property('mgmt/corosync', 'ipaddr'),
quorum_members => $corosync_nodes_processed['ips'],
unicast_addresses => $corosync_nodes_processed['ips'],
quorum_members_ids => $corosync_nodes_processed['ids'],
cluster_recheck_interval => $cluster_recheck_interval,
}
}
pcmk_nodes { 'pacemaker' :

View File

@ -17,6 +17,7 @@ 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)
$fuel_version = 0 + hiera('fuel_version')
if count($nodes) > 2 {
$policy = 'stop'
@ -24,10 +25,17 @@ if count($nodes) > 2 {
$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',
if $fuel_version < 9.0 {
# 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',
}
} else {
pcmk_property { 'no-quorum-policy':
ensure => present,
value => $policy,
}
}