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 056ace0c8c)
(cherry picked from commit ccb419ceb5)
This commit is contained in:
Michele Baldessari 2020-11-08 21:28:23 +01:00
parent ecf7416a6b
commit 6cbd813700
1 changed files with 7 additions and 0 deletions

View File

@ -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
}