Merge "Support new virtual_interfaces definition for VIPs"

This commit is contained in:
Jenkins 2014-10-31 01:34:55 +00:00 committed by Gerrit Code Review
commit 2ccf03ac78
2 changed files with 57 additions and 1 deletions

View File

@ -3,6 +3,8 @@ Element to install keepalived
Configuration
-------------
Configuration can be provided two ways: the simpler, deprecated, way:
keepalived:
# interface used for VRRP traffic
keepalive_interface: eth0
@ -22,3 +24,27 @@ Configuration
interface: eth0
- ip: fe80::5cc1:afff:fe58:143b/64
interface: br-ctlplane
or the more detailed newer way for more complicated setups. If both ``virtual_interfaces`` and ``keepalived`` keys are present, the latter is ignored.
virtual_interfaces:
instances:
- vrrp_instance_name: VI_CONTROL
virtual_router_id: 51
keepalive_interface: eth0
priority: 101
virtual_ips:
- ip: 192.0.2.254/24
interface: eth0
- vrrp_instance_name: VI_PUBLIC
virtual_router_id: 52
keepalive_interface: eth0
priority: 101
virtual_ips:
- ip: 10.16.15.154/24
interface: vlan25
vrrp_sync_groups:
- name: VG1
members:
- VI_CONTROL
- VI_PUBLIC

View File

@ -1,9 +1,38 @@
vrrp_script chk_haproxy {
script "killall -0 haproxy"
interval 2
weight 2
}
{{#virtual_interfaces}}
{{#instances}}
vrrp_instance {{vrrp_instance_name}} {
interface {{keepalive_interface}}
state MASTER
virtual_router_id {{virtual_router_id}}
priority {{priority}}
virtual_ipaddress {
{{#virtual_ips}}
{{ip}} dev {{interface}}
{{/virtual_ips}}
}
track_script {
chk_haproxy
}
}
{{/instances}}
{{#vrrp_sync_groups}}
vrrp_sync_group {{name}}
group {
{{#members}}
{{.}}
{{/members}}
}
{{/vrrp_sync_groups}}
{{/virtual_interfaces}}
{{^virtual_interfaces}}
vrrp_instance VI_1 {
interface {{keepalived.keepalive_interface}}
{{#keepalived.state}}
@ -26,3 +55,4 @@ vrrp_instance VI_1 {
chk_haproxy
}
}
{{/virtual_interfaces}}