Manage Redis VIP when deploying with keepalived

Previously we weren't creating Redis VIP in keepalived, causing Redis to
be unusable in non-HA deployments.

Change-Id: I0bb37f6fb3eed022288b2dcfc7a88e8ff88a7ace
Related-Bug: #1618510
This commit is contained in:
Jiri Stransky 2016-09-02 15:18:00 +02:00
parent 04b85b81a6
commit 16b2c0ab0e
1 changed files with 18 additions and 0 deletions

View File

@ -54,6 +54,11 @@
# A string.
# Defaults to false
#
# [*redis_virtual_ip*]
# Virtual IP on the redis service.
# A string.
# Defaults to false
#
class tripleo::keepalived (
$controller_virtual_ip,
$control_virtual_interface,
@ -62,6 +67,7 @@ class tripleo::keepalived (
$internal_api_virtual_ip = false,
$storage_virtual_ip = false,
$storage_mgmt_virtual_ip = false,
$redis_virtual_ip = false,
) {
case $::osfamily {
@ -141,4 +147,16 @@ class tripleo::keepalived (
}
}
if $redis_virtual_ip and $redis_virtual_ip != $controller_virtual_ip {
$redis_virtual_interface = interface_for_ip($redis_virtual_ip)
# KEEPALIVE STORAGE MANAGEMENT NETWORK
keepalived::instance { '56':
interface => $redis_virtual_interface,
virtual_ips => [join([$redis_virtual_ip, ' dev ', $redis_virtual_interface])],
state => 'MASTER',
track_script => ['haproxy'],
priority => 101,
}
}
}