2016-07-05 18:29:03 +02:00
|
|
|
{% for script in keepalived_scripts %}
|
|
|
|
vrrp_script {{ script.name }} {
|
|
|
|
script "{{ script.script }}"
|
2016-10-13 15:56:40 +02:00
|
|
|
interval {{ script.interval | default(1) }}
|
|
|
|
weight {{ script.weight | default(2) }}
|
|
|
|
fall: {{ script.fall | default(3) }}
|
|
|
|
raise: {{ script.raise | default(2) }}
|
|
|
|
timeout: {{ script.timeout | default(5) }}
|
2016-07-05 18:29:03 +02:00
|
|
|
}
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
{% for instance in keepalived_instances %}
|
|
|
|
vrrp_instance {{ instance.name }} {
|
|
|
|
interface {{ instance.interface }}
|
2016-08-04 16:58:37 +02:00
|
|
|
{% if instance.state is defined %}
|
2016-07-05 18:29:03 +02:00
|
|
|
state {{ instance.state }}
|
2016-08-04 16:58:37 +02:00
|
|
|
{% endif %}
|
2016-07-05 18:29:03 +02:00
|
|
|
virtual_router_id {{ instance.vrouter_id }}
|
|
|
|
priority {{ instance.priority }}
|
2016-08-04 16:58:37 +02:00
|
|
|
{% if instance.notify is defined %}
|
|
|
|
notify {{ instance.notify }}
|
|
|
|
{% endif %}
|
2016-10-13 15:56:40 +02:00
|
|
|
{% if instance.nopreempt is defined and instance.nopreempt %}
|
|
|
|
nopreempt
|
|
|
|
{% endif %}
|
2016-08-04 16:58:37 +02:00
|
|
|
{% if instance.authentication is defined %}
|
|
|
|
authentication {
|
|
|
|
auth_type {{ instance.authentication }}
|
|
|
|
auth_pass {{ instance.authpass }}
|
|
|
|
{% endif %}
|
2016-07-05 18:29:03 +02:00
|
|
|
virtual_ipaddress {
|
|
|
|
{% for addr in instance.v_addr %}
|
|
|
|
{{ addr }}
|
|
|
|
{% endfor %}
|
|
|
|
}
|
|
|
|
track_script {
|
|
|
|
{% for trk in instance.track_script %}
|
|
|
|
{{ trk }}
|
|
|
|
{% endfor %}
|
|
|
|
}
|
2016-10-13 15:56:40 +02:00
|
|
|
{% if instance.track_interface is defined %}
|
|
|
|
track_interface {
|
|
|
|
{% for if in instance.track_interface %}
|
|
|
|
{{ if }}
|
|
|
|
{% endfor %}
|
|
|
|
}
|
|
|
|
{% endif %}
|
2016-07-05 18:29:03 +02:00
|
|
|
}
|
|
|
|
{% endfor %}
|