From 3ffaf2d78f87a54c6447a7682ab0a5b8dffd0ef4 Mon Sep 17 00:00:00 2001 From: Alfredo Moralejo Date: Wed, 2 Sep 2020 16:32:21 +0200 Subject: [PATCH] Replace union to create tcp-check list for redis When using union, repeated arrays members are removed, so in this case we are missing a 'expect string +ok' after the QUIT. To avoid that i'm usinhg + operator to join arrays. Change-Id: I8f92469aa8dd0b8c21821b3ec62b2d43361ee428 (cherry picked from commit 3130cc880a1f714ee8b38855f471b85a18834c1d) --- manifests/haproxy.pp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/manifests/haproxy.pp b/manifests/haproxy.pp index 4acf1cecd..e972db987 100644 --- a/manifests/haproxy.pp +++ b/manifests/haproxy.pp @@ -1431,18 +1431,20 @@ class tripleo::haproxy ( } else { $redis_tcp_check_password_options = [] } - $redis_tcp_check_options = union($redis_tcp_check_ssl_options, $redis_tcp_check_password_options) + $redis_tcp_check_connect_options = union($redis_tcp_check_ssl_options, $redis_tcp_check_password_options) + $redis_tcp_check_common_options = ['send PING\r\n', + 'expect string +PONG', + 'send info\ replication\r\n', + 'expect string role:master', + 'send QUIT\r\n', + 'expect string +OK'] + $redis_tcp_check_options = $redis_tcp_check_connect_options + $redis_tcp_check_common_options haproxy::listen { 'redis': bind => $redis_bind_opts, options => { 'balance' => 'first', 'option' => [ 'tcp-check', 'tcplog', ], - 'tcp-check' => union($redis_tcp_check_options, ['send PING\r\n', - 'expect string +PONG', - 'send info\ replication\r\n', - 'expect string role:master', - 'send QUIT\r\n', - 'expect string +OK']), + 'tcp-check' => $redis_tcp_check_options, }, collect_exported => false, }