New ansible support (again)

This commit is contained in:
Miha Frangež 2026-02-23 16:54:47 +01:00 committed by jetomit
parent 3ff4ed5a77
commit 518c3bc7b8
12 changed files with 33 additions and 33 deletions

View file

@ -1,4 +1,4 @@
{% set dhcrelays = prefixes | selectattr('prefix', 'in', dhcp_servers | map('first') | ipaddr("network/prefix"))
{% set dhcrelays = prefixes | selectattr('prefix', 'in', dhcp_servers | map('first') | ansible.utils.ipaddr("network/prefix"))
| map(attribute="vrf.name") | map('regex_replace', '^', 'dhcrelay@') %}
{% set exits = [inventory_hostname, peer]|sort -%}
@ -13,11 +13,11 @@ vrrp_instance dhcrelay {
interface peerlink.4
{% for exit in exits %}
@{{ exit }} priority {{ loop.index }}
@{{ exit }} unicast_src_ip {{ "169.254.1.0/24" | ipaddr(loop.index + 1) | ipaddr('address') }}
@{{ exit }} unicast_src_ip {{ "169.254.1.0/24" | ansible.utils.ipaddr(loop.index + 1) | ansible.utils.ipaddr('address') }}
{% endfor %}
unicast_peer {
{% for exit in exits %}
@^{{ exit }} {{ "169.254.1.0/24" | ipaddr(loop.index + 1) | ipaddr('address') }}
@^{{ exit }} {{ "169.254.1.0/24" | ansible.utils.ipaddr(loop.index + 1) | ansible.utils.ipaddr('address') }}
{% endfor %}
}
notify_master "systemctl start {{ dhcrelays | join(' ') }}"