1
0

new hypervisor wip

This commit is contained in:
michael 2023-08-09 22:37:28 +10:00
parent 5007f0b68e
commit df3587032d
12 changed files with 85 additions and 14 deletions

View File

@ -1,5 +1,5 @@
[NetDev] [NetDev]
Name=br0 Name={{ item.name | regex_replace('^[0-9]*-', '') | regex_replace('\.netdev', '') }}
Kind=bridge Kind=bridge
[Bridge] [Bridge]

View File

@ -0,0 +1,11 @@
[Match]
Name={{ item.name | regex_replace('^[0-9]*-', '') | regex_replace('\.netdev', '') }}
[Link]
ARP={{ item.arp | default(false) }}
[Network]
DHCP={{ item.dhcp | default(false) }}
LinkLocalAddressing=false
LLDP=true
VLAN={{ item.vlan }}

View File

@ -1,6 +1,8 @@
[Match] [Match]
PermanentMACAddress={{ item.mac_address }} PermanentMACAddress={{ item.mac_address }}
[Link] [Link]
Name={{ item.name | regex_replace('^[0-9]*-', '') | regex_replace('\.link', '') }}
MACAddressPolicy=permanent MACAddressPolicy=permanent
MACAddress={{ item.mac_address }} MACAddress={{ item.mac_address }}
Name={{ item.name | regex_replace('^[0-9]*-', '') | regex_replace('\.link', '') }}

View File

@ -0,0 +1,19 @@
[Match]
MACAddress={{ item.mac_address }}
[Link]
ARP={{ item.arp }}
[Network]
DHCP={{ item.dhcp | default(true) }}
{% if item.bond %}
Bond={{ item.bond }}
{% endif %}
{% if item.bridge %}
Bridge={{ item.bridge }}
{% endif %}
{% if item.vlans %}
{% for vlan in item.vlans %}
VLAN={{ vlan }}
{% endfor %}
{% endif %}

View File

@ -0,0 +1,7 @@
[NetDev]
Name={{ item.name | regex_replace('^[0-9]*-', '') | regex_replace('\.netdev', '') }}
Kind=vlan
[VLAN]
Id={{ item.vlan_id }}
Protocol=802.1q

View File

@ -0,0 +1,44 @@
[Match]
Name={{ item.name | regex_replace('^[0-9]*-', '') | regex_replace('\.netdev', '') }}
[Link]
ARP={{ item.arp }}
[Network]
{% if item.nameserver.ipv4 is defined %}
{% for nameserver in item.nameserver.ipv4 %}
DNS={{ nameserver }}
{% endfor %}
{% endif %}
{% if item.nameserver.ipv6 is defined %}
{% for nameserver in item.nameserver.ipv6 %}
DNS={{ nameserver }}
{% endfor %}
{% endif %}
{% if item.address.ipv4 is defined %}
[Address]
Address={{ item.address.ipv4 }}
{% endif %}
{% if item.address.ipv6 is defined %}
[Address]
Address={{ item.address.ipv6 }}
{% endif %}
{% if item.gateway.ipv4 is defined %}
[Route]
Destination=0.0.0.0/0
Gateway={{ item.gateway.ipv4 }}
Scope=global
Protocol=static
Type=unicast
{% endif %}
{% if item.gateway.ipv6 is defined %}
[Route]
Destination=::/0
Gateway={{ item.gateway.ipv4 }}
Protocol=static
Type=unicast
{% endif %}

View File

@ -1,12 +0,0 @@
[Match]
MACAddress={{ item.mac_address }}
[Link]
ARP={{ item.arp }}
[Network]
DHCP=no
if item.bond
Bond={{ item.bond }}
if item.bridge
Bridge={{ item.bridge }}