From e7f8369185f269b58186c7e660fdc8046cc6e74a Mon Sep 17 00:00:00 2001 From: Sergei Gerasenko Date: Thu, 13 Jul 2023 19:01:38 +0000 Subject: [PATCH 1/2] Replace all occurences of illegal chars in the name var --- manifests/lvs/real_server.pp | 2 +- manifests/lvs/virtual_server.pp | 2 +- manifests/vrrp/script.pp | 2 +- manifests/vrrp/sync_group.pp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/lvs/real_server.pp b/manifests/lvs/real_server.pp index 08eed89cc5..acc5b6df11 100644 --- a/manifests/lvs/real_server.pp +++ b/manifests/lvs/real_server.pp @@ -30,7 +30,7 @@ Stdlib::Port $port, Keepalived::Options $options = {}, ) { - $_name = regsubst($name, '[:\/\n]', '') + $_name = regsubst($name, '[:\/\n]', '', 'G') concat::fragment { "keepalived.conf_lvs_real_server_${_name}": target => "${keepalived::config_dir}/keepalived.conf", diff --git a/manifests/lvs/virtual_server.pp b/manifests/lvs/virtual_server.pp index e238abed87..ec901bd0c9 100644 --- a/manifests/lvs/virtual_server.pp +++ b/manifests/lvs/virtual_server.pp @@ -99,7 +99,7 @@ Hash $real_server_options = {}, Optional[Stdlib::Fqdn] $virtualhost = undef, ) { - $_name = regsubst($name, '[:\/\n]', '') + $_name = regsubst($name, '[:\/\n]', '', 'G') unless $fwmark { assert_type(Stdlib::Port, $port) diff --git a/manifests/vrrp/script.pp b/manifests/vrrp/script.pp index 013b87a4ea..e7a80b814b 100644 --- a/manifests/vrrp/script.pp +++ b/manifests/vrrp/script.pp @@ -32,7 +32,7 @@ $no_weight = false, $init_fail = false, ) { - $_name = regsubst($name, '[:\/\n]', '') + $_name = regsubst($name, '[:\/\n]', '', 'G') if ! $weight { $weight_real = 2 diff --git a/manifests/vrrp/sync_group.pp b/manifests/vrrp/sync_group.pp index ee011c1a25..ceaa16cbe0 100644 --- a/manifests/vrrp/sync_group.pp +++ b/manifests/vrrp/sync_group.pp @@ -45,7 +45,7 @@ Boolean $global_tracking = false, Optional[Variant[String, Array[String]]] $track_interface = undef, ) { - $_name = regsubst($name, '[:\/\n]', '') + $_name = regsubst($name, '[:\/\n]', '', 'G') concat::fragment { "keepalived.conf_vrrp_sync_group_${_name}": target => "${keepalived::config_dir}/keepalived.conf", From 8bb96c820c263def62ef534ff472a68da45465e4 Mon Sep 17 00:00:00 2001 From: Sergei Gerasenko Date: Fri, 26 Jan 2024 16:39:55 +0000 Subject: [PATCH 2/2] Update REFERENCE.md --- REFERENCE.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/REFERENCE.md b/REFERENCE.md index 3c05eb1e55..729db40f72 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -1477,6 +1477,7 @@ The following parameters are available in the `keepalived::vrrp::script` defined * [`user`](#-keepalived--vrrp--script--user) * [`group`](#-keepalived--vrrp--script--group) * [`no_weight`](#-keepalived--vrrp--script--no_weight) +* [`init_fail`](#-keepalived--vrrp--script--init_fail) ##### `interval` @@ -1546,6 +1547,14 @@ Data type: `Any` +Default value: `false` + +##### `init_fail` + +Data type: `Any` + +assume script initially is in failed state if true. + Default value: `false` ### `keepalived::vrrp::sync_group`