diff options
26 files changed, 86 insertions, 68 deletions
diff --git a/inventory/host_vars/ch-equinox-ws.yml b/inventory/host_vars/ch-equinox-ws.yml index d4ff7afa..a9df0f06 100644 --- a/inventory/host_vars/ch-equinox-ws.yml +++ b/inventory/host_vars/ch-equinox-ws.yml @@ -9,11 +9,13 @@ install: network: nameservers: "{{ network_zones.lan.dns }}" domain: "{{ host_domain }}" - primary: - interface: enp8s0 + primary: &_network_primary_ + name: enp8s0 ip: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address') }}" mask: "{{ network_zones.lan.prefix | ipaddr('netmask') }}" gateway: "{{ network_zones.lan.gateway }}" + interfaces: + - *_network_primary_ base_modules_blacklist: "{{ base_modules_blacklist_none }}" diff --git a/inventory/host_vars/ch-gw-lan.yml b/inventory/host_vars/ch-gw-lan.yml index 22597138..e529690c 100644 --- a/inventory/host_vars/ch-gw-lan.yml +++ b/inventory/host_vars/ch-gw-lan.yml @@ -26,8 +26,13 @@ network: domain: "{{ host_domain }}" systemd_link: interfaces: "{{ install.interfaces }}" - primary: - interface: svc0 + primary: &_network_primary_ + name: svc0 ip: "{{ network_zones.svc.prefix | ipaddr(network_zones.svc.offsets[inventory_hostname]) | ipaddr('address') }}" mask: "{{ network_zones.svc.prefix | ipaddr('netmask') }}" gateway: "{{ network_zones.svc.gateway }}" + interfaces: + - *_network_primary_ + - name: lan0 + ip: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address') }}" + mask: "{{ network_zones.lan.prefix | ipaddr('netmask') }}" diff --git a/inventory/host_vars/ch-testvm.yml b/inventory/host_vars/ch-testvm.yml index 24455db5..b8c356fc 100644 --- a/inventory/host_vars/ch-testvm.yml +++ b/inventory/host_vars/ch-testvm.yml @@ -28,7 +28,7 @@ network: systemd_link: interfaces: "{{ install.interfaces }}" primary: - interface: primary0 + name: primary0 ip: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}" mask: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}" gateway: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.gateway }}" diff --git a/inventory/host_vars/ele-gwhetzner.yml b/inventory/host_vars/ele-gwhetzner.yml index 2519ab94..b85b5243 100644 --- a/inventory/host_vars/ele-gwhetzner.yml +++ b/inventory/host_vars/ele-gwhetzner.yml @@ -23,12 +23,14 @@ network: domain: "{{ host_domain }}" systemd_link: interfaces: "{{ install.interfaces }}" - primary: - interface: primary0 + primary: &_network_primary_ + name: primary0 ip: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}" mask: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}" gateway: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('address') }}" overlay: "{{ (hostvars[_vm_host_].vm_host.network.bridges.public.overlay.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.overlay.offsets[inventory_hostname])).split('/')[0] }}" + interfaces: + - *_network_primary_ external_ip: "{{ network.primary.overlay }}" @@ -48,7 +50,7 @@ wireguard_gateway_tunnels: addresses: - 192.168.254.1/30 ip_snat: - interface: "{{ network.primary.interface }}" + interface: "{{ network.primary.name }}" to: "{{ network.primary.overlay }}" port_forwardings: - dest: "{{ network.primary.overlay }}" @@ -67,7 +69,7 @@ wireguard_gateway_tunnels: addresses: - 192.168.254.5/30 ip_snat: - interface: "{{ network.primary.interface }}" + interface: "{{ network.primary.name }}" to: "{{ network.primary.overlay }}" port_forwardings: - dest: "{{ network.primary.overlay }}" diff --git a/roles/elevate/media/templates/firewall/elevate-festival.sh.j2 b/roles/elevate/media/templates/firewall/elevate-festival.sh.j2 index fbd1ad4f..29873aaa 100644 --- a/roles/elevate/media/templates/firewall/elevate-festival.sh.j2 +++ b/roles/elevate/media/templates/firewall/elevate-festival.sh.j2 @@ -15,7 +15,7 @@ MANGLE="$IPTABLES -t mangle" FILTER6="$IP6TABLES -t filter" MANGLE6="$IP6TABLES -t mangle" -LAN_IF="{{ network.primary.interface }}" +LAN_IF="{{ network.primary.name }}" LAN_IPADDR="{{ network.primary.ip }}" LAN_NETMASK="{{ network.primary.mask }}" diff --git a/roles/elevate/media/templates/firewall/elevate-office.sh.j2 b/roles/elevate/media/templates/firewall/elevate-office.sh.j2 index b2f7f416..93805cdf 100644 --- a/roles/elevate/media/templates/firewall/elevate-office.sh.j2 +++ b/roles/elevate/media/templates/firewall/elevate-office.sh.j2 @@ -15,7 +15,7 @@ MANGLE="$IPTABLES -t mangle" FILTER6="$IP6TABLES -t filter" MANGLE6="$IP6TABLES -t mangle" -LAN_IF="{{ network.primary.interface }}" +LAN_IF="{{ network.primary.name }}" LAN_IPADDR="192.168.0.250" LAN_NETMASK="255.255.255.0" diff --git a/roles/elevate/media/templates/firewall/lan-only.sh.j2 b/roles/elevate/media/templates/firewall/lan-only.sh.j2 index 4431ade0..07665d62 100644 --- a/roles/elevate/media/templates/firewall/lan-only.sh.j2 +++ b/roles/elevate/media/templates/firewall/lan-only.sh.j2 @@ -15,7 +15,7 @@ MANGLE="$IPTABLES -t mangle" FILTER6="$IP6TABLES -t filter" MANGLE6="$IP6TABLES -t mangle" -LAN_IF="{{ network.primary.interface }}" +LAN_IF="{{ network.primary.name }}" LAN_IPADDR="{{ network.primary.ip }}" LAN_NETMASK="{{ network.primary.mask }}" diff --git a/roles/elevate/media/templates/firewall/r3-with-lan.sh.j2 b/roles/elevate/media/templates/firewall/r3-with-lan.sh.j2 index c65e42ed..22d91301 100644 --- a/roles/elevate/media/templates/firewall/r3-with-lan.sh.j2 +++ b/roles/elevate/media/templates/firewall/r3-with-lan.sh.j2 @@ -15,11 +15,11 @@ MANGLE="$IPTABLES -t mangle" FILTER6="$IP6TABLES -t filter" MANGLE6="$IP6TABLES -t mangle" -LAN_IF="{{ network.primary.interface }}" +LAN_IF="{{ network.primary.name }}" LAN_IPADDR="{{ network.primary.ip }}" LAN_NETMASK="{{ network.primary.mask }}" -EXT_IF="{{ network.primary.interface }}.{{ network_zones.ccinet.vlan }}" +EXT_IF="{{ network.primary.name }}.{{ network_zones.ccinet.vlan }}" EXT_IPADDR="89.106.211.61" EXT_SERVICES_TCP="80 443 {{ ansible_port }}" diff --git a/roles/elevate/media/templates/firewall/r3.sh.j2 b/roles/elevate/media/templates/firewall/r3.sh.j2 index 83a6297f..a8425825 100644 --- a/roles/elevate/media/templates/firewall/r3.sh.j2 +++ b/roles/elevate/media/templates/firewall/r3.sh.j2 @@ -15,7 +15,7 @@ MANGLE="$IPTABLES -t mangle" FILTER6="$IP6TABLES -t filter" MANGLE6="$IP6TABLES -t mangle" -EXT_IF="{{ network.primary.interface }}" +EXT_IF="{{ network.primary.name }}" EXT_IPADDR="89.106.211.61" EXT_SERVICES_TCP="80 443 {{ ansible_port }}" diff --git a/roles/elevate/media/templates/netplan/elevate-festival.yaml.j2 b/roles/elevate/media/templates/netplan/elevate-festival.yaml.j2 index 3bd97cb6..db924c20 100644 --- a/roles/elevate/media/templates/netplan/elevate-festival.yaml.j2 +++ b/roles/elevate/media/templates/netplan/elevate-festival.yaml.j2 @@ -2,7 +2,7 @@ network: version: 2 renderer: networkd ethernets: - {{ network.primary.interface }}: + {{ network.primary.name }}: addresses: [ {{ (network.primary.ip + '/' + network.primary.mask) | ipaddr('address/prefix') }} ] gateway4: {{ network.primary.gateway }} accept-ra: false diff --git a/roles/elevate/media/templates/netplan/elevate-office.yaml.j2 b/roles/elevate/media/templates/netplan/elevate-office.yaml.j2 index acc944fd..1dcecf7a 100644 --- a/roles/elevate/media/templates/netplan/elevate-office.yaml.j2 +++ b/roles/elevate/media/templates/netplan/elevate-office.yaml.j2 @@ -2,7 +2,7 @@ network: version: 2 renderer: networkd ethernets: - {{ network.primary.interface }}: + {{ network.primary.name }}: addresses: [ 192.168.0.250/24 ] gateway4: 192.168.0.1 accept-ra: false diff --git a/roles/elevate/media/templates/netplan/lan-only.yaml.j2 b/roles/elevate/media/templates/netplan/lan-only.yaml.j2 index 3bd97cb6..db924c20 100644 --- a/roles/elevate/media/templates/netplan/lan-only.yaml.j2 +++ b/roles/elevate/media/templates/netplan/lan-only.yaml.j2 @@ -2,7 +2,7 @@ network: version: 2 renderer: networkd ethernets: - {{ network.primary.interface }}: + {{ network.primary.name }}: addresses: [ {{ (network.primary.ip + '/' + network.primary.mask) | ipaddr('address/prefix') }} ] gateway4: {{ network.primary.gateway }} accept-ra: false diff --git a/roles/elevate/media/templates/netplan/r3-with-lan.yaml.j2 b/roles/elevate/media/templates/netplan/r3-with-lan.yaml.j2 index 275ef953..3812e27f 100644 --- a/roles/elevate/media/templates/netplan/r3-with-lan.yaml.j2 +++ b/roles/elevate/media/templates/netplan/r3-with-lan.yaml.j2 @@ -2,13 +2,13 @@ network: version: 2 renderer: networkd ethernets: - {{ network.primary.interface }}: + {{ network.primary.name }}: addresses: [ {{ (network.primary.ip + '/' + network.primary.mask) | ipaddr('address/prefix') }} ] accept-ra: false vlans: - {{ network.primary.interface }}.{{ network_zones.ccinet.vlan }}: + {{ network.primary.name }}.{{ network_zones.ccinet.vlan }}: id: {{ network_zones.ccinet.vlan }} - link: {{ network.primary.interface }} + link: {{ network.primary.name }} addresses: [ 89.106.211.61/27 ] gateway4: 89.106.211.33 accept-ra: false diff --git a/roles/elevate/media/templates/netplan/r3.yaml.j2 b/roles/elevate/media/templates/netplan/r3.yaml.j2 index 2429a4b7..91654c09 100644 --- a/roles/elevate/media/templates/netplan/r3.yaml.j2 +++ b/roles/elevate/media/templates/netplan/r3.yaml.j2 @@ -2,7 +2,7 @@ network: version: 2 renderer: networkd ethernets: - {{ network.primary.interface }}: + {{ network.primary.name }}: addresses: [ 89.106.211.61/27 ] gateway4: 89.106.211.33 accept-ra: false diff --git a/roles/installer/debian/preseed/templates/preseed_debian-buster-with-raid.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_debian-buster-with-raid.cfg.j2 index 739d00ed..b92aa1eb 100644 --- a/roles/installer/debian/preseed/templates/preseed_debian-buster-with-raid.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_debian-buster-with-raid.cfg.j2 @@ -9,7 +9,7 @@ d-i keyboard-configuration/xkb-keymap select us d-i hw-detect/load_firmware boolean false -d-i netcfg/choose_interface select {{ install_interface | default(hostvars[install_hostname].network_cooked.primary.interface) }} +d-i netcfg/choose_interface select {{ install_interface | default(hostvars[install_hostname].network_cooked.primary.name) }} {% if 'install_dhcp' in hostvars[install_hostname] and hostvars[install_hostname].install_dhcp %} d-i netcfg/disable_dhcp boolean false d-i netcfg/disable_autoconfig boolean false diff --git a/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2 index de69c10c..dd0aa0ab 100644 --- a/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2 @@ -9,7 +9,7 @@ d-i keyboard-configuration/xkb-keymap select us d-i hw-detect/load_firmware boolean false -d-i netcfg/choose_interface select {{ install_interface | default(hostvars[install_hostname].network_cooked.primary.interface) }} +d-i netcfg/choose_interface select {{ install_interface | default(hostvars[install_hostname].network_cooked.primary.name) }} {% if 'install_dhcp' in hostvars[install_hostname] and hostvars[install_hostname].install_dhcp %} d-i netcfg/disable_dhcp boolean false d-i netcfg/disable_autoconfig boolean false diff --git a/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2 index 35bb28b4..453349db 100644 --- a/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2 @@ -9,7 +9,7 @@ d-i keyboard-configuration/xkb-keymap select us d-i hw-detect/load_firmware boolean false -d-i netcfg/choose_interface select {{ install_interface | default(hostvars[install_hostname].network_cooked.primary.interface) }} +d-i netcfg/choose_interface select {{ install_interface | default(hostvars[install_hostname].network_cooked.primary.name) }} {% if 'install_dhcp' in hostvars[install_hostname] and hostvars[install_hostname].install_dhcp %} d-i netcfg/disable_dhcp boolean false d-i netcfg/disable_autoconfig boolean false diff --git a/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2 index fb6ebfde..da33c0f5 100644 --- a/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2 @@ -9,7 +9,7 @@ d-i keyboard-configuration/xkb-keymap select us d-i hw-detect/load_firmware boolean false -d-i netcfg/choose_interface select {{ install_interface | default(hostvars[install_hostname].network_cooked.primary.interface) }} +d-i netcfg/choose_interface select {{ install_interface | default(hostvars[install_hostname].network_cooked.primary.name) }} {% if 'install_dhcp' in hostvars[install_hostname] and hostvars[install_hostname].install_dhcp %} d-i netcfg/disable_dhcp boolean false d-i netcfg/disable_autoconfig boolean false diff --git a/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2 index 85a77f38..ab18b8a2 100644 --- a/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2 @@ -16,7 +16,7 @@ d-i hw-detect/load_firmware boolean false {% if preseed_no_netplan %} d-i netcfg/do_not_use_netplan boolean true {% endif %} -d-i netcfg/choose_interface select {{ install_interface | default(hostvars[install_hostname].network_cooked.primary.interface) }} +d-i netcfg/choose_interface select {{ install_interface | default(hostvars[install_hostname].network_cooked.primary.name) }} {% if 'install_dhcp' in hostvars[install_hostname] and hostvars[install_hostname].install_dhcp %} d-i netcfg/disable_dhcp boolean false d-i netcfg/disable_autoconfig boolean false diff --git a/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2 index 093bfdc5..33cf0738 100644 --- a/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2 @@ -16,7 +16,7 @@ d-i hw-detect/load_firmware boolean false {% if preseed_no_netplan %} d-i netcfg/do_not_use_netplan boolean true {% endif %} -d-i netcfg/choose_interface select {{ install_interface | default(hostvars[install_hostname].network_cooked.primary.interface) }} +d-i netcfg/choose_interface select {{ install_interface | default(hostvars[install_hostname].network_cooked.primary.name) }} {% if 'install_dhcp' in hostvars[install_hostname] and hostvars[install_hostname].install_dhcp %} d-i netcfg/disable_dhcp boolean false d-i netcfg/disable_autoconfig boolean false diff --git a/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2 index bb510710..b86d7523 100644 --- a/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2 @@ -13,7 +13,7 @@ d-i keyboard-configuration/layoutcode string us d-i hw-detect/load_firmware boolean false -d-i netcfg/choose_interface select {{ install_interface | default(hostvars[install_hostname].network_cooked.primary.interface) }} +d-i netcfg/choose_interface select {{ install_interface | default(hostvars[install_hostname].network_cooked.primary.name) }} {% if 'install_dhcp' in hostvars[install_hostname] and hostvars[install_hostname].install_dhcp %} d-i netcfg/disable_dhcp boolean false d-i netcfg/disable_autoconfig boolean false diff --git a/roles/installer/debian/preseed/templates/preseed_xubuntu-focal-desktop.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_xubuntu-focal-desktop.cfg.j2 index bf4395a6..e20825bf 100644 --- a/roles/installer/debian/preseed/templates/preseed_xubuntu-focal-desktop.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_xubuntu-focal-desktop.cfg.j2 @@ -19,7 +19,7 @@ d-i hw-detect/load_firmware boolean false {% if preseed_no_netplan %} d-i netcfg/do_not_use_netplan boolean true {% endif %} -d-i netcfg/choose_interface select {{ install_interface | default(hostvars[install_hostname].network_cooked.primary.interface) }} +d-i netcfg/choose_interface select {{ install_interface | default(hostvars[install_hostname].network_cooked.primary.name) }} {% if 'install_dhcp' in hostvars[install_hostname] and hostvars[install_hostname].install_dhcp %} d-i netcfg/disable_dhcp boolean false d-i netcfg/disable_autoconfig boolean false diff --git a/roles/installer/openbsd/autoinstall/templates/auto_install.conf.j2 b/roles/installer/openbsd/autoinstall/templates/auto_install.conf.j2 index 4220be38..6989d7e0 100644 --- a/roles/installer/openbsd/autoinstall/templates/auto_install.conf.j2 +++ b/roles/installer/openbsd/autoinstall/templates/auto_install.conf.j2 @@ -1,6 +1,6 @@ System hostname = {{ hostvars[install_hostname].host_name }} -Which network interface do you wish to configure = {{ install_interface | default(hostvars[install_hostname].network_cooked.primary.interface) }} +Which network interface do you wish to configure = {{ install_interface | default(hostvars[install_hostname].network_cooked.primary.name) }} {% if 'install_dhcp' in hostvars[install_hostname] and hostvars[install_hostname].install_dhcp %} IPv4 address = dhcp {% else %} diff --git a/roles/vm/network/tasks/main.yml b/roles/vm/network/tasks/main.yml index b17aba8b..27a7682a 100644 --- a/roles/vm/network/tasks/main.yml +++ b/roles/vm/network/tasks/main.yml @@ -1,24 +1,25 @@ --- -- block: - - name: remove legacy systemd.link units - loop: - - 50-virtio-kernel-names.link - - 99-default.link - file: - name: "/etc/systemd/network/{{ item }}" - state: absent +- name: configure systemd link units + when: network_cooked.systemd_link is defined + block: + - name: remove legacy systemd.link units + loop: + - 50-virtio-kernel-names.link + - 99-default.link + file: + name: "/etc/systemd/network/{{ item }}" + state: absent - - name: install systemd network link units - loop: "{{ network.systemd_link.interfaces }}" - loop_control: - label: "{{ item.name }}" - index_var: interface_index - template: - src: systemd.link.j2 - dest: "/etc/systemd/network/{{ '%02d' | format(interface_index + 11) }}-{{ item.name }}.link" - notify: rebuild initramfs + - name: install systemd network link units + loop: "{{ network_cooked.systemd_link.interfaces }}" + loop_control: + label: "{{ item.name }}" + index_var: interface_index + template: + src: systemd.link.j2 + dest: "/etc/systemd/network/{{ '%02d' | format(interface_index + 11) }}-{{ item.name }}.link" + notify: rebuild initramfs - when: network.systemd_link is defined - name: install basic interface config template: diff --git a/roles/vm/network/templates/interfaces.j2 b/roles/vm/network/templates/interfaces.j2 index db0e322f..3c151144 100644 --- a/roles/vm/network/templates/interfaces.j2 +++ b/roles/vm/network/templates/interfaces.j2 @@ -6,25 +6,33 @@ source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback +{% for interface in network_cooked.interfaces %} -# The primary network interface -auto {{ network.primary.interface }} -iface {{ network.primary.interface }} inet static + +auto {{ interface.name }} +iface {{ interface.name }} inet static pre-up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/accept_ra pre-up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/autoconf - address {{ network.primary.ip }} - netmask {{ network.primary.mask }} -{% if 'overlay' in network.primary %} - up /bin/ip addr add dev $IFACE {{ network.primary.overlay }}/32 - up /bin/ip route add default via {{ network.primary.gateway }} src {{ network.primary.overlay }} - down /bin/ip route del default via {{ network.primary.gateway }} src {{ network.primary.overlay }} - down /bin/ip addr del dev $IFACE {{ network.primary.overlay }}/32 -{% else %} - gateway {{ network.primary.gateway }} -{% endif %} -{% if 'prefix6' in network.primary %} + address {{ interface.ip }} + netmask {{ interface.mask }} +{% if 'overlay' in interface %} + up /bin/ip addr add dev $IFACE {{ interface.overlay }}/32 +{% if 'gateway' in interface %} + up /bin/ip route add default via {{ interface.gateway }} src {{ interface.overlay }} + down /bin/ip route del default via {{ interface.gateway }} src {{ interface.overlay }} +{% endif %} + down /bin/ip addr del dev $IFACE {{ interface.overlay }}/32 +{% else %} +{% if 'gateway' in interface %} + gateway {{ interface.gateway }} +{% endif %} +{% endif %} +{% if 'prefix6' in interface %} -iface {{ network.primary.interface }} inet6 static - address {{ network.primary.prefix6 }} - gateway {{ network.primary.gateway6 }} -{% endif %} +iface {{ interface.name }} inet6 static + address {{ interface.prefix6 }} +{% if 'gateway6' in interface %} + gateway {{ interface.gateway6 }} +{% endif %} +{% endif %} +{% endfor %} diff --git a/roles/vm/network/templates/resolv.conf.j2 b/roles/vm/network/templates/resolv.conf.j2 index a32ec181..f62b6ed7 100644 --- a/roles/vm/network/templates/resolv.conf.j2 +++ b/roles/vm/network/templates/resolv.conf.j2 @@ -1,4 +1,4 @@ -{% for nsrv in network.nameservers %} +{% for nsrv in network_cooked.nameservers %} nameserver {{ nsrv }} {% endfor %} search {{ network.domain }} |