1
0

51 lines
1.2 KiB
Plaintext
Raw Normal View History

2023-08-09 22:37:28 +10:00
[Match]
2023-08-10 21:29:39 +10:00
Name={{ item.name | regex_replace('^[0-9]*-', '') | regex_replace('\.network', '') }}
2023-08-09 22:37:28 +10:00
[Link]
2023-08-10 21:29:39 +10:00
ARP={{ item.arp | default(true) }}
2023-08-09 22:37:28 +10:00
[Network]
2023-08-10 21:29:39 +10:00
DHCP={{ item.dhcp | default(true) }}
LinkLocalAddressing=False
LLDP={{ item.lldp | default(true) }}
{% if item.nameserver is defined and item.nameserver.ipv4 is defined -%}
2023-08-09 22:55:51 +10:00
{% for nameserver in item.nameserver.ipv4 -%}
2023-08-09 22:37:28 +10:00
DNS={{ nameserver }}
2023-08-09 22:55:51 +10:00
{% endfor -%}
{% endif -%}
2023-08-10 21:29:39 +10:00
{% if item.nameserver is defined and item.nameserver.ipv6 is defined -%}
2023-08-09 22:55:51 +10:00
{% for nameserver in item.nameserver.ipv6 -%}
2023-08-09 22:37:28 +10:00
DNS={{ nameserver }}
2023-08-09 22:55:51 +10:00
{% endfor -%}
{% endif -%}
2023-08-09 22:37:28 +10:00
2023-08-10 21:29:39 +10:00
{% if item.address is defined %}
2023-08-09 22:37:28 +10:00
[Address]
2023-08-10 21:29:39 +10:00
{% if item.address.ipv4 is defined -%}
{% for address in item.address.ipv4 -%}
Address={{ address }}
{% endfor -%}
{% endif -%}
{% if item.address.ipv6 is defined -%}
{% for address in item.address.ipv6 -%}
Address={{ address }}
{% endfor -%}
2023-08-09 22:55:51 +10:00
{% endif -%}
{% endif -%}
2023-08-10 21:29:39 +10:00
{% if item.gateway is defined and item.gateway.ipv4 is defined %}
2023-08-09 22:37:28 +10:00
[Route]
Destination=0.0.0.0/0
Gateway={{ item.gateway.ipv4 }}
Scope=global
Protocol=static
Type=unicast
2023-08-09 22:55:51 +10:00
{% endif -%}
2023-08-09 22:37:28 +10:00
2023-08-10 21:29:39 +10:00
{% if item.gateway is defined and item.gateway.ipv6 is defined %}
2023-08-09 22:37:28 +10:00
[Route]
Destination=::/0
2023-08-09 22:55:51 +10:00
Gateway={{ item.gateway.ipv6 }}
2023-08-09 22:37:28 +10:00
Protocol=static
Type=unicast
2023-08-09 22:55:51 +10:00
{% endif -%}