summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-06-16 20:36:25 +0000
committerGerrit Code Review <review@openstack.org>2017-06-16 20:36:25 +0000
commitca05d7101a739cff0eba7588bcbc869d5ff302d3 (patch)
tree0bfe630deab94d7df6be035ebfd9f683e10ae1db
parentdfe30e0c786fa7c16eda3be2c54f3fefc551e8c4 (diff)
parent265cb21748b4dec8dd95430684d08d1addf9e9a0 (diff)
Merge "Add support for autofencing to Pacemaker Remote." into stable/ocata
-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 @@
22# Authkey for pacemaker remote nodes 22# Authkey for pacemaker remote nodes
23# Defaults to unset 23# Defaults to unset
24# 24#
25# [*pcs_tries*]
26# (Optional) The number of times pcs commands should be retried.
27# Defaults to hiera('pcs_tries', 20)
28#
29# [*enable_fencing*]
30# (Optional) Whether or not to manage stonith devices for nodes
31# Defaults to hiera('enable_fencing', false)
32#
25# [*step*] 33# [*step*]
26# (Optional) The current step in deployment. See tripleo-heat-templates 34# (Optional) The current step in deployment. See tripleo-heat-templates
27# for more details. 35# for more details.
@@ -29,9 +37,28 @@
29# 37#
30class tripleo::profile::base::pacemaker_remote ( 38class tripleo::profile::base::pacemaker_remote (
31 $remote_authkey, 39 $remote_authkey,
40 $pcs_tries = hiera('pcs_tries', 20),
41 $enable_fencing = hiera('enable_fencing', false),
32 $step = hiera('step'), 42 $step = hiera('step'),
33) { 43) {
34 class { '::pacemaker::remote': 44 class { '::pacemaker::remote':
35 remote_authkey => $remote_authkey, 45 remote_authkey => $remote_authkey,
36 } 46 }
47 $enable_fencing_real = str2bool($enable_fencing) and $step >= 5
48
49 class { '::pacemaker::stonith':
50 disable => !$enable_fencing_real,
51 tries => $pcs_tries,
52 }
53
54 if $enable_fencing_real {
55 include ::tripleo::fencing
56
57 # enable stonith after all Pacemaker resources have been created
58 Pcmk_resource<||> -> Class['tripleo::fencing']
59 Pcmk_constraint<||> -> Class['tripleo::fencing']
60 Exec <| tag == 'pacemaker_constraint' |> -> Class['tripleo::fencing']
61 # enable stonith after all fencing devices have been created
62 Class['tripleo::fencing'] -> Class['pacemaker::stonith']
63 }
37} 64}