keepalived: add minimal support for virtual_routes

This commit is contained in:
jeltz 2022-09-03 14:09:37 +02:00
parent c7d7320367
commit 61cdb980ea
Signed by: jeltz
GPG key ID: 800882B66C0C3326
2 changed files with 19 additions and 0 deletions

View file

@ -1,5 +1,6 @@
--- ---
keepalived__virtual_addresses: {} keepalived__virtual_addresses: {}
keepalived__virtual_routes: {}
keepalived__notify_master: [] keepalived__notify_master: []
keepalived__notify_backup: [] keepalived__notify_backup: []
keepalived__notify_fault: [] keepalived__notify_fault: []

View file

@ -55,6 +55,15 @@ vrrp_instance instance_v4 {
{{ address }} dev {{ dev }} {{ address }} dev {{ dev }}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endfor %}
}
virtual_routes {
{% for dev, addresses in keepalived__virtual_routes.items() %}
{% for address in addresses %}
{% if address | ansible.utils.ipv4 %}
{{ address }} dev {{ dev }}
{% endif %}
{% endfor %}
{% endfor %} {% endfor %}
} }
{% if not (ipv4_enabled and ipv6_enabled) %} {% if not (ipv4_enabled and ipv6_enabled) %}
@ -81,6 +90,15 @@ vrrp_instance instance_v6 {
{{ address }} dev {{ dev }} {{ address }} dev {{ dev }}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endfor %}
}
virtual_routes {
{% for dev, addresses in keepalived__virtual_routes.items() %}
{% for address in addresses %}
{% if address | ansible.utils.ipv6 %}
{{ address }} dev {{ dev }}
{% endif %}
{% endfor %}
{% endfor %} {% endfor %}
} }
{% if not (ipv4_enabled and ipv6_enabled) %} {% if not (ipv4_enabled and ipv6_enabled) %}