diff options
-rw-r--r-- | manifests/keepalived.pp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/manifests/keepalived.pp b/manifests/keepalived.pp index aa0e5d6..35b0821 100644 --- a/manifests/keepalived.pp +++ b/manifests/keepalived.pp @@ -64,6 +64,11 @@ # A string. # Defaults to false # +# [*virtual_router_id_base*] +# Base for range used for virtual router IDs. +# An integer. +# Defaults to 50 +# class tripleo::keepalived ( $controller_virtual_ip, @@ -75,6 +80,7 @@ class tripleo::keepalived ( $storage_mgmt_virtual_ip = false, $redis_virtual_ip = false, $ovndbs_virtual_ip = false, + $virtual_router_id_base = 50, ) { case $::osfamily { @@ -100,7 +106,7 @@ class tripleo::keepalived ( } # KEEPALIVE INSTANCE CONTROL - keepalived::instance { '51': + keepalived::instance { "${$virtual_router_id_base + 1}": interface => $control_virtual_interface, virtual_ips => [join([$controller_virtual_ip, ' dev ', $control_virtual_interface])], state => 'MASTER', @@ -109,7 +115,7 @@ class tripleo::keepalived ( } # KEEPALIVE INSTANCE PUBLIC - keepalived::instance { '52': + keepalived::instance { "${$virtual_router_id_base + 2}": interface => $public_virtual_interface, virtual_ips => [join([$public_virtual_ip, ' dev ', $public_virtual_interface])], state => 'MASTER', @@ -126,7 +132,7 @@ class tripleo::keepalived ( $internal_api_virtual_netmask = '32' } # KEEPALIVE INTERNAL API NETWORK - keepalived::instance { '53': + keepalived::instance { "${$virtual_router_id_base + 3}": interface => $internal_api_virtual_interface, virtual_ips => [join(["${internal_api_virtual_ip}/${internal_api_virtual_netmask}", ' dev ', $internal_api_virtual_interface])], state => 'MASTER', @@ -143,7 +149,7 @@ class tripleo::keepalived ( $storage_virtual_netmask = '32' } # KEEPALIVE STORAGE NETWORK - keepalived::instance { '54': + keepalived::instance { "${$virtual_router_id_base + 4}": interface => $storage_virtual_interface, virtual_ips => [join(["${storage_virtual_ip}/${storage_virtual_netmask}", ' dev ', $storage_virtual_interface])], state => 'MASTER', @@ -160,7 +166,7 @@ class tripleo::keepalived ( $storage_mgmt_virtual_netmask = '32' } # KEEPALIVE STORAGE MANAGEMENT NETWORK - keepalived::instance { '55': + keepalived::instance { "${$virtual_router_id_base + 5}": interface => $storage_mgmt_virtual_interface, virtual_ips => [join(["${storage_mgmt_virtual_ip}/${storage_mgmt_virtual_netmask}", ' dev ', $storage_mgmt_virtual_interface])], state => 'MASTER', @@ -177,7 +183,7 @@ class tripleo::keepalived ( $redis_virtual_netmask = '32' } # KEEPALIVE STORAGE MANAGEMENT NETWORK - keepalived::instance { '56': + keepalived::instance { "${$virtual_router_id_base + 6}": interface => $redis_virtual_interface, virtual_ips => [join(["${redis_virtual_ip}/${redis_virtual_netmask}", ' dev ', $redis_virtual_interface])], state => 'MASTER', @@ -185,10 +191,11 @@ class tripleo::keepalived ( priority => 101, } } + if $ovndbs_virtual_ip and $ovndbs_virtual_ip != $controller_virtual_ip { $ovndbs_virtual_interface = interface_for_ip($ovndbs_virtual_ip) # KEEPALIVE OVNDBS MANAGEMENT NETWORK - keepalived::instance { '57': + keepalived::instance { "${$virtual_router_id_base + 7}": interface => $ovndbs_virtual_interface, virtual_ips => [join([$ovndbs_virtual_ip, ' dev ', $ovndbs_virtual_interface])], state => 'MASTER', |