Allow passing aditional arguments to wsrep_provider_options

This commit allows to inject arbitrary arguments into the
wsrep_provider_options string.
Operators should be extremely careful in doing so as there is no
validation or syntax checking whatsoever.

Example:

ExtraConfig:
  tripleo::profile::pacemaker::database::mysql_bundle::provider_options: 'evs.suspect_timeout=PT30S'

results in:

wsrep_provider_options = evs.suspect_timeout=PT30S;gcache.recover=no;gmcast.listen_addr=tcp://172.17.0.151:4567;socket.ssl_key=/etc/pki/tls/private/mysql.key;socket.ssl_cert=/etc/pki/tls/certs/mysql.crt;socket.ssl_cipher=AES128-SHA256;socket.ssl_ca=/etc/ipa/ca.crt;

Change-Id: Ie4711ace66846b10252bccdddae84e045af3f604
This commit is contained in:
Luca Miccini 2022-09-28 13:39:09 +02:00
parent f928691ce2
commit 171814ebba
2 changed files with 21 additions and 3 deletions

View File

@ -200,6 +200,10 @@
# (optional) Recover gcache on galera startup.
# Defaults to false
#
# [*provider_options*]
# (optional) Allows passing extra options to wsrep_provider_options.
# Defaults to undef
#
class tripleo::profile::pacemaker::database::mysql_bundle (
$mysql_docker_image = undef,
$control_port = 3123,
@ -239,6 +243,7 @@ class tripleo::profile::pacemaker::database::mysql_bundle (
$force_ocf = false,
$gcache_size = undef,
$gcache_recover = false,
$provider_options = undef,
) {
if $bootstrap_node and $::hostname == downcase($bootstrap_node) {
$pacemaker_master = true
@ -356,10 +361,15 @@ class tripleo::profile::pacemaker::database::mysql_bundle (
$mysqld_options_sst = {}
}
}
if $ipv6 {
$wsrep_provider_options = "${gcache_options}gmcast.listen_addr=tcp://[::]:4567;${tls_options}"
if $provider_options {
$extra_options = "${provider_options};"
} else {
$wsrep_provider_options = "${gcache_options}gmcast.listen_addr=tcp://${gmcast_listen_addr}:4567;${tls_options}"
$extra_options = ''
}
if $ipv6 {
$wsrep_provider_options = "${extra_options}${gcache_options}gmcast.listen_addr=tcp://[::]:4567;${tls_options}"
} else {
$wsrep_provider_options = "${extra_options}${gcache_options}gmcast.listen_addr=tcp://${gmcast_listen_addr}:4567;${tls_options}"
}
$mysqld_options_mysqld = {

View File

@ -0,0 +1,8 @@
---
features:
- |
Add support for injecting arbitrary arguments into the wsrep_provider_options
string.
Operators should be extremely careful in doing so as there is no validation
or syntax checking whatsoever.