keepalived: add blackhole routes

This commit is contained in:
jeltz 2023-09-11 13:28:27 +02:00
parent 14288224b4
commit e87de918db
Signed by: jeltz
GPG key ID: 800882B66C0C3326
2 changed files with 8 additions and 0 deletions

View file

@ -100,6 +100,8 @@
keepalived__virtual_routes:
ext0:
- 45.66.111.204/30
keepalived__virtual_blackholes:
- 45.66.111.200/30
keepalived__main: "{{ inventory_hostname_short == 'infra-1' }}"
roles:
- keepalived

View file

@ -71,6 +71,9 @@ vrrp_instance instance_v4 {
{{ address }} dev {{ dev }}
{% endif %}
{% endfor %}
{% endfor %}
{% for address in keepalived__virtual_blackholes | ansible.utils.ipv4 %}
blackhole {{ address }}
{% endfor %}
}
{% if not (ipv4_enabled and ipv6_enabled) %}
@ -106,6 +109,9 @@ vrrp_instance instance_v6 {
{{ address }} dev {{ dev }}
{% endif %}
{% endfor %}
{% endfor %}
{% for addresses in keepalived__virtual_blackholes | ansible.utils.ipv6 %}
blackhole {{ address }}
{% endfor %}
}
{% if not (ipv4_enabled and ipv6_enabled) %}