wgvirtipd/dev/config/keepalived.conf.tmpl
2024-01-21 22:52:57 +01:00

65 lines
1.2 KiB
Cheetah

! Configuration File for keepalived
global_defs {
notification_email {
root@localhost
}
notification_email_from keepalived@localhost
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS_DEVEL
vrrp_skip_check_adv_addr
vrrp_garp_interval 0
vrrp_gna_interval 0
}
vrrp_script check {
script /etc/keepalived/check.sh
interval 1
timeout 1
rise 5
fall 5
}
vrrp_instance VI_1 {
state {{ item.keepalived_state }}
interface wg0
priority {{ item.keepalived_priority }}
virtual_router_id 51
advert_int 1
virtual_ipaddress {
{{ keepalived_ip }}/{{ mask_bits }} dev wg0 label wg0:0
}
unicast_src_ip {{ item.ip }}
unicast_peer {
{% for iitem in keypairs %}
{% if iitem.item != item.item %}
{{ iitem.ip }}
{% endif %}
{% endfor %}
}
authentication {
auth_type PASS
auth_pass password
}
track_script {
check
}
notify_master /etc/keepalived/master.sh
}
virtual_server {{ keepalived_ip }} 8080 {
delay_loop 6
lb_algo rr
lb_kind NAT
protocol TCP
real_server {{ item.ip }} 8080 {
TCP_CHECK {
connect_timeout 10
}
}
}