Fix ceph-nfs duplicate property

In change I78c16c9fb28211a7a8ec2187ae76b9a072b76ea2 we eliminated
startup races with ceph nfs, but we need to make sure we do
not create duplicate properies or puppet will fail.

While we're at it we also point the bootstrapnode at
ceph_nfs_short_bootstrap_node_name instead of which is more correct.
It is functionally the same if ceph-nfs and manila-share run on the
same nodes, which is likely the case in most cases, but best
make it correct while we're at it.

Closes-Bug: #1798020

Change-Id: I5a41f95b2d91a25fe617afb9ada0b5201d2b7ef7
(cherry picked from commit 7e3219ff2b)
(cherry picked from commit 148347b2d0)
This commit is contained in:
Michele Baldessari 2018-10-11 08:47:26 +02:00 committed by Tom Barron
parent fd99abfc2b
commit 6a6f932efc
1 changed files with 12 additions and 7 deletions

View File

@ -20,7 +20,7 @@
#
# [*bootstrap_node*]
# (Optional) The hostname of the node responsible for bootstrapping tasks
# Defaults to hiera('manila_share_short_bootstrap_node_name')
# Defaults to hiera('ceph_nfs_short_bootstrap_node_name')
#
# [*step*]
# (Optional) The current step in deployment. See tripleo-heat-templates
@ -32,7 +32,7 @@
# Defaults to hiera('pcs_tries', 20)
#
class tripleo::profile::pacemaker::ceph_nfs (
$bootstrap_node = hiera('manila_share_short_bootstrap_node_name'),
$bootstrap_node = hiera('ceph_nfs_short_bootstrap_node_name'),
$step = hiera('step'),
$pcs_tries = hiera('pcs_tries', 20),
) {
@ -124,11 +124,16 @@ class tripleo::profile::pacemaker::ceph_nfs (
# See comment on pacemaker::property at step2
$ceph_nfs_short_node_names = hiera('ceph_nfs_short_node_names')
$ceph_nfs_short_node_names.each |String $node_name| {
pacemaker::property { "ceph-nfs-role-${node_name}":
property => 'ceph-nfs-role',
value => true,
tries => $pcs_tries,
node => $node_name,
# We only set the properties for the non-bootstrap nodes
# because we set the property for the bootstrap node at step 2
# already
if $node_name != $bootstrap_node {
pacemaker::property { "ceph-nfs-role-${node_name}":
property => 'ceph-nfs-role',
value => true,
tries => $pcs_tries,
node => $node_name,
}
}
}