From 6cbd81370058526a269ce4deef7c95763b694991 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Sun, 8 Nov 2020 21:28:23 +0100 Subject: [PATCH] Generic cluster properties support Sometimes in certain environments we need to set specific cluster properties to tune the control plane to that specific situation. Tested with: tripleo::profile::base::pacemaker::cluster_properties: test: property: shutdown-escalation value: 6m tries: 5 test2: property: priority-fencing-delay value: 10 tries: 5 test3: property: startup-fencing value: false tries: 5 And obtained the correctly set properties: [root@controller-0 hieradata]# pcs property Cluster Properties: ... priority-fencing-delay: 10 shutdown-escalation: 6m startup-fencing: false Change-Id: Iebd1ae24a69fb0bdc5f7f7c75a1a79e9c608ba96 (cherry picked from commit 056ace0c8cac6089948d2752825a5c3ebdd1424c) (cherry picked from commit ccb419ceb5dca6fbd4e03fbf67eb9c01fc6158c3) --- manifests/profile/base/pacemaker.pp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/manifests/profile/base/pacemaker.pp b/manifests/profile/base/pacemaker.pp index e84ee6634..8e27b808d 100644 --- a/manifests/profile/base/pacemaker.pp +++ b/manifests/profile/base/pacemaker.pp @@ -93,6 +93,9 @@ # (optional) Sets PCMK_tls_priorities in /etc/sysconfig/pacemaker when set # Defaults to hiera('tripleo::pacemaker::tls_priorities', undef) # +# [*cluster_properties*] +# (optional) Cluster-wide properties that can be set by an operator via hiera +# Defaults to {} class tripleo::profile::base::pacemaker ( $step = Integer(hiera('step')), @@ -112,11 +115,13 @@ class tripleo::profile::base::pacemaker ( $enable_instanceha = hiera('tripleo::instanceha', false), $pcsd_bind_addr = undef, $tls_priorities = hiera('tripleo::pacemaker::tls_priorities', undef), + $cluster_properties = {}, ) { if count($remote_short_node_names) != count($remote_node_ips) { fail("Count of ${remote_short_node_names} is not equal to count of ${remote_node_ips}") } + validate_legacy(Hash, 'validate_hash', $cluster_properties) if $pcs_password == undef { fail('The $pcs_password param is undefined, did you forget to include ::tripleo::profile::base::pacemaker in your role?') @@ -285,6 +290,8 @@ class tripleo::profile::base::pacemaker ( } if ($step >= 2 and $pacemaker_master) { + create_resources('pacemaker::property', $cluster_properties) + if ! $enable_instanceha { include ::pacemaker::resource_defaults }