new hypervisor wip
This commit is contained in:
parent
5007f0b68e
commit
df3587032d
@ -1,5 +1,5 @@
|
||||
[NetDev]
|
||||
Name=br0
|
||||
Name={{ item.name | regex_replace('^[0-9]*-', '') | regex_replace('\.netdev', '') }}
|
||||
Kind=bridge
|
||||
|
||||
[Bridge]
|
11
ansible/playbooks/templates/bridge.network.j2
Normal file
11
ansible/playbooks/templates/bridge.network.j2
Normal 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 }}
|
@ -1,6 +1,8 @@
|
||||
[Match]
|
||||
PermanentMACAddress={{ item.mac_address }}
|
||||
|
||||
[Link]
|
||||
Name={{ item.name | regex_replace('^[0-9]*-', '') | regex_replace('\.link', '') }}
|
||||
MACAddressPolicy=permanent
|
||||
MACAddress={{ item.mac_address }}
|
||||
Name={{ item.name | regex_replace('^[0-9]*-', '') | regex_replace('\.link', '') }}
|
||||
|
19
ansible/playbooks/templates/ethernet.network.j2
Normal file
19
ansible/playbooks/templates/ethernet.network.j2
Normal 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 %}
|
7
ansible/playbooks/templates/vlan.netdev.j2
Normal file
7
ansible/playbooks/templates/vlan.netdev.j2
Normal 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
|
44
ansible/playbooks/templates/vlan.network.j2
Normal file
44
ansible/playbooks/templates/vlan.network.j2
Normal 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 %}
|
@ -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 }}
|
Loading…
Reference in New Issue
Block a user