blob: c02b54cfb07d453b7a0c6770b953a43c667a27b5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
global_defs {
script_user nobody
enable_script_security
}
vrrp_script chk_avail {
script "{{ keepalived_healthcheck_script }}"
interval 10
weight 10
rise 6
fall 1
}
vrrp_instance {{ inventory_hostname }} {
interface {{ keepalived_interface }}
state BACKUP
virtual_router_id {{ keepalived_virtual_router_id }}
priority {{ keepalived_priority }}
advert_int 1
unicast_src_ip {{ ansible_host }}
unicast_peer {
{% for peer in groups['keepalived'] if hostvars[peer]['ansible_host'] != ansible_host %}
{{ hostvars[peer]['ansible_host'] }}
{% endfor %}
}
virtual_ipaddress {
{{ keepalived_virtual_ip }} dev {{ keepalived_interface }}
}
track_script {
chk_avail
}
}
|