ansible-roles/keepalived/templates/keepalived.conf.j2

37 lines
1.0 KiB
Django/Jinja

{% for script in keepalived_scripts %}
vrrp_script {{ script.name }} {
script "{{ script.script }}"
interval {{ script.interval }}
weight {{ script.weight }}
}
{% endfor %}
{% for instance in keepalived_instances %}
vrrp_instance {{ instance.name }} {
interface {{ instance.interface }}
{% if instance.state is defined %}
state {{ instance.state }}
{% endif %}
virtual_router_id {{ instance.vrouter_id }}
priority {{ instance.priority }}
{% if instance.notify is defined %}
notify {{ instance.notify }}
{% endif %}
{% if instance.authentication is defined %}
authentication {
auth_type {{ instance.authentication }}
auth_pass {{ instance.authpass }}
{% endif %}
virtual_ipaddress {
{% for addr in instance.v_addr %}
{{ addr }}
{% endfor %}
}
track_script {
{% for trk in instance.track_script %}
{{ trk }}
{% endfor %}
}
}
{% endfor %}