aboutsummaryrefslogtreecommitdiffstats
path: root/manifests
diff options
context:
space:
mode:
authorJiri Stransky <jistr@redhat.com>2015-06-04 16:07:48 +0200
committerJiri Stransky <jistr@redhat.com>2015-06-12 18:40:50 +0200
commit9793b3c97203e7ecc95aead151e8b983ae2552e0 (patch)
tree4e8de93b7c96df4c66d75ce1aaf46748bb9d6060 /manifests
parenta077eaf307998b3a9996fc5c0846f6604139a3e7 (diff)
Configure fencing devices
Adds a class to configure fence devices and a helper function which helps to select the devices for configuration on appropriate nodes. Depends on patches outside OpenStack's Gerrit: https://github.com/redhat-openstack/puppet-pacemaker/pull/50 https://github.com/redhat-openstack/puppet-pacemaker/pull/52 Change-Id: I819fc8c126ec47cd207c59b3dcf92ff699649c5a
Diffstat (limited to 'manifests')
-rw-r--r--manifests/fencing.pp62
1 files changed, 62 insertions, 0 deletions
diff --git a/manifests/fencing.pp b/manifests/fencing.pp
new file mode 100644
index 0000000..55280a9
--- /dev/null
+++ b/manifests/fencing.pp
@@ -0,0 +1,62 @@
+# == Class: tripleo::fencing
+#
+# Configure Pacemaker fencing devices for TripleO.
+#
+# === Parameters:
+#
+# [*config*]
+# JSON config of fencing devices, using the following structure:
+# {
+# "devices": [
+# {
+# "agent": "AGENT_NAME",
+# "host_mac": "HOST_MAC_ADDRESS",
+# "params": {"PARAM_NAME": "PARAM_VALUE"}
+# }
+# ]
+# }
+# For instance:
+# {
+# "devices": [
+# {
+# "agent": "fence_xvm",
+# "host_mac": "52:54:00:aa:bb:cc",
+# "params": {
+# "multicast_address": "225.0.0.12",
+# "port": "baremetal_0",
+# "manage_fw": true,
+# "manage_key_file": true,
+# "key_file": "/etc/fence_xvm.key",
+# "key_file_password": "abcdef"
+# }
+# }
+# ]
+# }
+# Defaults to {}
+#
+# [*tries*]
+# Number of attempts when creating fence devices and constraints.
+# Defaults to 10
+#
+# [*try_sleep*]
+# Delay (in seconds) between attempts when creating fence devices
+# and constraints.
+# Defaults to 3
+class tripleo::fencing(
+ $config = {},
+ $tries = 10,
+ $try_sleep = 3,
+) {
+ $common_params = {
+ 'tries' => $tries,
+ 'try_sleep' => $try_sleep,
+ }
+
+ $all_devices = $config['devices']
+
+ $xvm_devices = local_fence_devices('fence_xvm', $all_devices)
+ create_resources('pacemaker::stonith::fence_xvm', $xvm_devices, $common_params)
+
+ $ipmilan_devices = local_fence_devices('fence_ipmilan', $all_devices)
+ create_resources('pacemaker::stonith::fence_ipmilan', $ipmilan_devices, $common_params)
+}