70 lines
1.9 KiB
Django/Jinja
70 lines
1.9 KiB
Django/Jinja
# {{ ansible_managed }}
|
|
|
|
global_defs {
|
|
notification_email {
|
|
{% for mail in keepalived_notification_mails %}
|
|
{{ mail }}
|
|
{% endfor %}
|
|
}
|
|
notification_email_from {{ keepalived_mail_from }}
|
|
smtp_server {{ keepalived_smtp_server }}
|
|
}
|
|
{% for vrrp_script_name, vrrp_script in keepalived_vrrp_scripts.items() %}
|
|
|
|
vrrp_script {{ vrrp_script_name }} {
|
|
script "{{ vrrp_script.script }}"
|
|
interval {{ vrrp_script.interval|default(2) }}
|
|
fall {{ vrrp_script.fall|default(2) }}
|
|
rise {{ vrrp_script.rise|default(2) }}
|
|
weight {{ vrrp_script.weight|default(1) }}
|
|
}
|
|
{% endfor %}
|
|
{% for track_file_name, track_file in keepalived_track_files.items() %}
|
|
|
|
track_file {{ track_file_name }} {
|
|
file "{{ track_file.file }}"
|
|
weight {{ track_file.weight|default(1) }}
|
|
}
|
|
{% endfor %}
|
|
{% for vrrp_instance_name, vrrp_instance in keepalived_vrrp_instances.items() %}
|
|
|
|
vrrp_instance {{ vrrp_instance_name }} {
|
|
state {{ vrrp_instance.state|upper }}
|
|
interface {{ vrrp_instance.interface }}
|
|
virtual_router_id {{ vrrp_instance.virtual_router_id }}
|
|
priority {{ vrrp_instance.priority }}
|
|
{% if 'smtp_alert' in vrrp_instance and vrrp_instance.smtp_alert %}
|
|
smtp_alert
|
|
{% endif %}
|
|
{% if 'authentication' in vrrp_instance %}
|
|
authentication {
|
|
auth_type {{ vrrp_instance.authentication.type|upper }}
|
|
auth_pass {{ vrrp_instance.authentication.pass }}
|
|
}
|
|
{% endif %}
|
|
virtual_ipaddress {
|
|
{% for ipaddress in vrrp_instance.virtual_ipaddresses %}
|
|
{{ ipaddress }}
|
|
{% endfor %}
|
|
}
|
|
{% if 'track_scripts' in vrrp_instance %}
|
|
track_script {
|
|
{% for script in vrrp_instance.track_scripts %}
|
|
{{ script }}
|
|
{% endfor %}
|
|
}
|
|
{% endif %}
|
|
{% if 'track_files' in vrrp_instance %}
|
|
track_file {
|
|
{% for script in vrrp_instance.track_files %}
|
|
{{ script }}
|
|
{% endfor %}
|
|
}
|
|
{% endif %}
|
|
{% if 'notify' in vrrp_instance %}
|
|
{% for state, script in vrrp_instance.notify.items() %}
|
|
notify_{{ state }} "{{ script|trim }}"
|
|
{% endfor %}
|
|
{% endif %}
|
|
}
|
|
{% endfor %}
|