aboutsummaryrefslogtreecommitdiffstats
path: root/manifests
diff options
context:
space:
mode:
authorChris Jones <cmsj@tenshu.net>2017-04-25 16:05:27 +0100
committerChris Jones <cmsj@tenshu.net>2017-06-13 08:41:26 +0000
commit265cb21748b4dec8dd95430684d08d1addf9e9a0 (patch)
treeffdba3db93a7e1963f0fcf3ea98cfe24abce8730 /manifests
parent7ea37eaadc8f6daf5524c20cb6dfa7ee525c966f (diff)
Add support for autofencing to Pacemaker Remote.
We now configure stonith devices for Pacemaker Remote nodes. Change-Id: I87c60bd56feac6dedc00a3c458b805aa9b71d9ce Depends-On: Ifb4d19a6b9920b0e340555d6441878c7234eb197 Partial-Bug: #1686115 (cherry picked from commit 19d177c182f35a16bf3ddccfcf7fad6bb54c7bb2)
Diffstat (limited to 'manifests')
-rw-r--r--manifests/profile/base/pacemaker_remote.pp27
1 files changed, 27 insertions, 0 deletions
diff --git a/manifests/profile/base/pacemaker_remote.pp b/manifests/profile/base/pacemaker_remote.pp
index e0fff63..dfe0a3e 100644
--- a/manifests/profile/base/pacemaker_remote.pp
+++ b/manifests/profile/base/pacemaker_remote.pp
@@ -22,6 +22,14 @@
# Authkey for pacemaker remote nodes
# Defaults to unset
#
+# [*pcs_tries*]
+# (Optional) The number of times pcs commands should be retried.
+# Defaults to hiera('pcs_tries', 20)
+#
+# [*enable_fencing*]
+# (Optional) Whether or not to manage stonith devices for nodes
+# Defaults to hiera('enable_fencing', false)
+#
# [*step*]
# (Optional) The current step in deployment. See tripleo-heat-templates
# for more details.
@@ -29,9 +37,28 @@
#
class tripleo::profile::base::pacemaker_remote (
$remote_authkey,
+ $pcs_tries = hiera('pcs_tries', 20),
+ $enable_fencing = hiera('enable_fencing', false),
$step = hiera('step'),
) {
class { '::pacemaker::remote':
remote_authkey => $remote_authkey,
}
+ $enable_fencing_real = str2bool($enable_fencing) and $step >= 5
+
+ class { '::pacemaker::stonith':
+ disable => !$enable_fencing_real,
+ tries => $pcs_tries,
+ }
+
+ if $enable_fencing_real {
+ include ::tripleo::fencing
+
+ # enable stonith after all Pacemaker resources have been created
+ Pcmk_resource<||> -> Class['tripleo::fencing']
+ Pcmk_constraint<||> -> Class['tripleo::fencing']
+ Exec <| tag == 'pacemaker_constraint' |> -> Class['tripleo::fencing']
+ # enable stonith after all fencing devices have been created
+ Class['tripleo::fencing'] -> Class['pacemaker::stonith']
+ }
}