exit: add DHCP relay for new server

Really quite shoddy as it is right now. Should get better once the old
server is retired.
This commit is contained in:
Timotej Lazar 2024-07-13 18:08:31 +02:00
parent bb41d406f8
commit 99aef43574
5 changed files with 27 additions and 43 deletions

View file

@ -1,3 +1,5 @@
{% set dhcrelays = prefixes | selectattr('prefix', 'in', dhcp_servers | map('first') | ipaddr("network/prefix"))
| map(attribute="vrf.name") | map('regex_replace', '^', 'dhcrelay@') %}
{% set exits = [inventory_hostname, peer]|sort -%}
global_defs {
@ -18,5 +20,8 @@ vrrp_instance dhcrelay {
@^{{ exit }} {{ "169.254.1.0/24" | ipaddr(loop.index + 1) | ipaddr('address') }}
{% endfor %}
}
notify /usr/local/bin/keepalive-service
notify_master "systemctl start {{ dhcrelays | join(' ') }}"
notify_fault "systemctl start {{ dhcrelays | join(' ') }}"
notify_backup "systemctl stop {{ dhcrelays | join(' ') }}"
notify_stop "systemctl stop {{ dhcrelays | join(' ') }}"
}