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
This commit is contained in:
parent
b61166b1e1
commit
3130cc880a
|
@ -1395,18 +1395,20 @@ class tripleo::haproxy (
|
||||||
} else {
|
} else {
|
||||||
$redis_tcp_check_password_options = []
|
$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':
|
haproxy::listen { 'redis':
|
||||||
bind => $redis_bind_opts,
|
bind => $redis_bind_opts,
|
||||||
options => {
|
options => {
|
||||||
'balance' => 'first',
|
'balance' => 'first',
|
||||||
'option' => [ 'tcp-check', 'tcplog', ],
|
'option' => [ 'tcp-check', 'tcplog', ],
|
||||||
'tcp-check' => union($redis_tcp_check_options, ['send PING\r\n',
|
'tcp-check' => $redis_tcp_check_options,
|
||||||
'expect string +PONG',
|
|
||||||
'send info\ replication\r\n',
|
|
||||||
'expect string role:master',
|
|
||||||
'send QUIT\r\n',
|
|
||||||
'expect string +OK']),
|
|
||||||
},
|
},
|
||||||
collect_exported => false,
|
collect_exported => false,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue