Browse Source

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 3130cc880a)
changes/80/749880/2
Alfredo Moralejo 4 weeks ago
parent
commit
3ffaf2d78f
1 changed files with 9 additions and 7 deletions
  1. +9
    -7
      manifests/haproxy.pp

+ 9
- 7
manifests/haproxy.pp View File

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


Loading…
Cancel
Save