Add socat listen backend to clustercheck service

Allow clustercheck to be started on-demand by either socat or
xinetd. T-h-t configures the backend to be run by Kolla at
container start.

Change-Id: Ie7ede82a755e729d66e077f97e87b3d6c816ed3c
Related-Bug: #1928693
This commit is contained in:
Damien Ciabrini 2021-05-17 17:22:14 +02:00
parent 0b981a701b
commit a77fefb671
1 changed files with 11 additions and 2 deletions

View File

@ -43,6 +43,14 @@ class tripleo::profile::pacemaker::clustercheck (
) {
if $step >= 1 {
# configuration used by the galera resource agent,
# and by the clustercheck service when it is configured
# to listen via socat
if is_ipv6_address($bind_address) {
$socat_listen_type = 'tcp6-listen'
} else {
$socat_listen_type = 'tcp4-listen'
}
file { '/etc/sysconfig/clustercheck' :
ensure => file,
mode => '0600',
@ -50,10 +58,11 @@ class tripleo::profile::pacemaker::clustercheck (
group => 'mysql',
content => "MYSQL_USERNAME=${clustercheck_user}\n
MYSQL_PASSWORD='${clustercheck_password}'\n
MYSQL_HOST=localhost\n",
MYSQL_HOST=localhost\n
TRIPLEO_SOCAT_BIND='${socat_listen_type}:9200,bind=\"${bind_address}\",reuseaddr,fork'\n",
}
# the clustercheck service is run via xinet in the container
# configuration used when clustercheck is run via xinet
xinetd::service { 'galera-monitor' :
bind => $bind_address,
port => '9200',