diff options
author | Jenkins <jenkins@review.openstack.org> | 2015-04-28 11:40:52 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2015-04-28 11:40:52 +0000 |
commit | a388f84654701f5d6604e0833a6a8fe1b90fcfdd (patch) | |
tree | 0882b6f4e58db9207c7e36c4db19410331ea7fd8 /manifests | |
parent | a3d93790c284863d9b4bc32eae8dd35c6e6cb68c (diff) | |
parent | 8c29315cbcd5e255e1287e86cd8134590b9e7d06 (diff) |
Merge "Make setup of keepalived optional via manage_vip parameter"
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/loadbalancer.pp | 81 |
1 files changed, 44 insertions, 37 deletions
diff --git a/manifests/loadbalancer.pp b/manifests/loadbalancer.pp index ef90a18..6b5999a 100644 --- a/manifests/loadbalancer.pp +++ b/manifests/loadbalancer.pp @@ -19,6 +19,10 @@ # # === Parameters: # +# [*manage_vip*] +# Whether to enable keepalived to manage the VIPs or not +# Defaults to true +# # [*controller_host*] # (Deprecated)Host or group of hosts to load-balance the services # Can be a string or an array. @@ -143,6 +147,7 @@ class tripleo::loadbalancer ( $control_virtual_interface, $public_virtual_interface, $public_virtual_ip, + $manage_vip = true, $controller_host = undef, $controller_hosts = undef, $controller_hosts_names = undef, @@ -185,46 +190,48 @@ class tripleo::loadbalancer ( $controller_hosts_names_real = $controller_hosts_names } - case $::osfamily { - 'RedHat': { - $keepalived_name_is_process = false - $keepalived_vrrp_script = 'systemctl status haproxy.service' - } # RedHat - 'Debian': { - $keepalived_name_is_process = true - $keepalived_vrrp_script = undef - } - default: { - warning('Please configure keepalived defaults in tripleo::loadbalancer.') - $keepalived_name_is_process = undef - $keepalived_vrrp_script = undef + if $manage_vip { + case $::osfamily { + 'RedHat': { + $keepalived_name_is_process = false + $keepalived_vrrp_script = 'systemctl status haproxy.service' + } # RedHat + 'Debian': { + $keepalived_name_is_process = true + $keepalived_vrrp_script = undef + } + default: { + warning('Please configure keepalived defaults in tripleo::loadbalancer.') + $keepalived_name_is_process = undef + $keepalived_vrrp_script = undef + } + } + + class { '::keepalived': } + keepalived::vrrp_script { 'haproxy': + name_is_process => $keepalived_name_is_process, + script => $keepalived_vrrp_script, + } + + # KEEPALIVE INSTANCE CONTROL + keepalived::instance { '51': + interface => $control_virtual_interface, + virtual_ips => [join([$controller_virtual_ip, ' dev ', $control_virtual_interface])], + state => 'MASTER', + track_script => ['haproxy'], + priority => 101, + } + + # KEEPALIVE INSTANCE PUBLIC + keepalived::instance { '52': + interface => $public_virtual_interface, + virtual_ips => [join([$public_virtual_ip, ' dev ', $public_virtual_interface])], + state => 'MASTER', + track_script => ['haproxy'], + priority => 101, } } - class { '::keepalived': } - keepalived::vrrp_script { 'haproxy': - name_is_process => $keepalived_name_is_process, - script => $keepalived_vrrp_script, - } - - # KEEPALIVE INSTANCE CONTROL - keepalived::instance { '51': - interface => $control_virtual_interface, - virtual_ips => [join([$controller_virtual_ip, ' dev ', $control_virtual_interface])], - state => 'MASTER', - track_script => ['haproxy'], - priority => 101, - } - - # KEEPALIVE INSTANCE PUBLIC - keepalived::instance { '52': - interface => $public_virtual_interface, - virtual_ips => [join([$public_virtual_ip, ' dev ', $public_virtual_interface])], - state => 'MASTER', - track_script => ['haproxy'], - priority => 101, - } - sysctl::value { 'net.ipv4.ip_nonlocal_bind': value => '1' } class { '::haproxy': |