From ed3885ac85e1a005d972662f966849bf626d5fba Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 12 Jun 2020 13:44:47 +0200 Subject: initial tests with new network config --- inventory/host_vars/ch-equinox-ws.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'inventory/host_vars/ch-equinox-ws.yml') 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 }}" -- cgit v1.2.3 From 742ab1e5e72c4f7b6678cf586309d6d98d96272d Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 21 Jun 2020 04:11:47 +0200 Subject: further improved network config --- inventory/host_vars/ch-equinox-ws.yml | 3 +-- inventory/host_vars/ch-gw-lan.yml | 6 ++---- inventory/host_vars/ch-testvm.yml | 7 ++++--- inventory/host_vars/ele-gwhetzner.yml | 3 +-- roles/elevate/media/templates/firewall/elevate-festival.sh.j2 | 4 ++-- roles/elevate/media/templates/firewall/lan-only.sh.j2 | 4 ++-- roles/elevate/media/templates/firewall/r3-with-lan.sh.j2 | 4 ++-- roles/elevate/media/templates/netplan/elevate-festival.yaml.j2 | 2 +- roles/elevate/media/templates/netplan/lan-only.yaml.j2 | 2 +- roles/elevate/media/templates/netplan/r3-with-lan.yaml.j2 | 2 +- roles/installer/debian/preseed/tasks/main.yml | 3 +++ .../preseed/templates/preseed_debian-buster-with-raid.cfg.j2 | 4 ++-- .../debian/preseed/templates/preseed_debian-buster.cfg.j2 | 9 ++++++--- .../debian/preseed/templates/preseed_debian-jessie.cfg.j2 | 4 ++-- .../debian/preseed/templates/preseed_debian-stretch.cfg.j2 | 4 ++-- .../debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2 | 4 ++-- .../debian/preseed/templates/preseed_ubuntu-focal.cfg.j2 | 9 ++++++--- .../debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2 | 4 ++-- .../preseed/templates/preseed_xubuntu-focal-desktop.cfg.j2 | 4 ++-- .../installer/openbsd/autoinstall/templates/auto_install.conf.j2 | 4 ++-- roles/vm/network/templates/interfaces.j2 | 4 ++-- 21 files changed, 48 insertions(+), 42 deletions(-) (limited to 'inventory/host_vars/ch-equinox-ws.yml') diff --git a/inventory/host_vars/ch-equinox-ws.yml b/inventory/host_vars/ch-equinox-ws.yml index a9df0f06..fb1da511 100644 --- a/inventory/host_vars/ch-equinox-ws.yml +++ b/inventory/host_vars/ch-equinox-ws.yml @@ -11,8 +11,7 @@ network: domain: "{{ host_domain }}" 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') }}" + prefix: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address/prefix') }}" gateway: "{{ network_zones.lan.gateway }}" interfaces: - *_network_primary_ diff --git a/inventory/host_vars/ch-gw-lan.yml b/inventory/host_vars/ch-gw-lan.yml index e529690c..7158e127 100644 --- a/inventory/host_vars/ch-gw-lan.yml +++ b/inventory/host_vars/ch-gw-lan.yml @@ -28,11 +28,9 @@ network: interfaces: "{{ install.interfaces }}" 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') }}" + prefix: "{{ network_zones.svc.prefix | ipaddr(network_zones.svc.offsets[inventory_hostname]) | ipaddr('address/prefix) }}" 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') }}" + prefix: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address/prefix) }}" diff --git a/inventory/host_vars/ch-testvm.yml b/inventory/host_vars/ch-testvm.yml index b8c356fc..ebe758ab 100644 --- a/inventory/host_vars/ch-testvm.yml +++ b/inventory/host_vars/ch-testvm.yml @@ -27,10 +27,11 @@ network: domain: "{{ host_domain }}" systemd_link: interfaces: "{{ install.interfaces }}" - primary: + 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') }}" + prefix: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address/prefix') }}" gateway: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.gateway }}" prefix6: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix6 | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address/prefix') }}" gateway6: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.gateway6 }}" + interfaces: + - *_network_primary_ diff --git a/inventory/host_vars/ele-gwhetzner.yml b/inventory/host_vars/ele-gwhetzner.yml index b85b5243..bd20ea1e 100644 --- a/inventory/host_vars/ele-gwhetzner.yml +++ b/inventory/host_vars/ele-gwhetzner.yml @@ -25,8 +25,7 @@ network: interfaces: "{{ install.interfaces }}" 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') }}" + prefix: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address/prefix') }}" 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: diff --git a/roles/elevate/media/templates/firewall/elevate-festival.sh.j2 b/roles/elevate/media/templates/firewall/elevate-festival.sh.j2 index 29873aaa..8cb56cd6 100644 --- a/roles/elevate/media/templates/firewall/elevate-festival.sh.j2 +++ b/roles/elevate/media/templates/firewall/elevate-festival.sh.j2 @@ -16,8 +16,8 @@ FILTER6="$IP6TABLES -t filter" MANGLE6="$IP6TABLES -t mangle" LAN_IF="{{ network.primary.name }}" -LAN_IPADDR="{{ network.primary.ip }}" -LAN_NETMASK="{{ network.primary.mask }}" +LAN_IPADDR="{{ network.primary.prefix | ipaddr('address') }}" +LAN_NETMASK="{{ network.primary.prefix | ipaddr('netmask') }}" EXT_IF="wg-gwhetzner" EXT_IPADDR="192.168.254.2" diff --git a/roles/elevate/media/templates/firewall/lan-only.sh.j2 b/roles/elevate/media/templates/firewall/lan-only.sh.j2 index 07665d62..0ec06ba2 100644 --- a/roles/elevate/media/templates/firewall/lan-only.sh.j2 +++ b/roles/elevate/media/templates/firewall/lan-only.sh.j2 @@ -16,8 +16,8 @@ FILTER6="$IP6TABLES -t filter" MANGLE6="$IP6TABLES -t mangle" LAN_IF="{{ network.primary.name }}" -LAN_IPADDR="{{ network.primary.ip }}" -LAN_NETMASK="{{ network.primary.mask }}" +LAN_IPADDR="{{ network.primary.prefix | ipaddr('address') }}" +LAN_NETMASK="{{ network.primary.prefix | ipaddr('netmask') }}" ######################### 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 22d91301..c7fe5f6b 100644 --- a/roles/elevate/media/templates/firewall/r3-with-lan.sh.j2 +++ b/roles/elevate/media/templates/firewall/r3-with-lan.sh.j2 @@ -16,8 +16,8 @@ FILTER6="$IP6TABLES -t filter" MANGLE6="$IP6TABLES -t mangle" LAN_IF="{{ network.primary.name }}" -LAN_IPADDR="{{ network.primary.ip }}" -LAN_NETMASK="{{ network.primary.mask }}" +LAN_IPADDR="{{ network.primary.prefix | ipaddr('address') }}" +LAN_NETMASK="{{ network.primary.prefix | ipaddr('netmask') }}" EXT_IF="{{ network.primary.name }}.{{ network_zones.ccinet.vlan }}" EXT_IPADDR="89.106.211.61" diff --git a/roles/elevate/media/templates/netplan/elevate-festival.yaml.j2 b/roles/elevate/media/templates/netplan/elevate-festival.yaml.j2 index db924c20..ef227fed 100644 --- a/roles/elevate/media/templates/netplan/elevate-festival.yaml.j2 +++ b/roles/elevate/media/templates/netplan/elevate-festival.yaml.j2 @@ -3,7 +3,7 @@ network: renderer: networkd ethernets: {{ network.primary.name }}: - addresses: [ {{ (network.primary.ip + '/' + network.primary.mask) | ipaddr('address/prefix') }} ] + addresses: [ {{ network.primary.prefix }} ] gateway4: {{ network.primary.gateway }} accept-ra: false nameservers: diff --git a/roles/elevate/media/templates/netplan/lan-only.yaml.j2 b/roles/elevate/media/templates/netplan/lan-only.yaml.j2 index db924c20..ef227fed 100644 --- a/roles/elevate/media/templates/netplan/lan-only.yaml.j2 +++ b/roles/elevate/media/templates/netplan/lan-only.yaml.j2 @@ -3,7 +3,7 @@ network: renderer: networkd ethernets: {{ network.primary.name }}: - addresses: [ {{ (network.primary.ip + '/' + network.primary.mask) | ipaddr('address/prefix') }} ] + addresses: [ {{ network.primary.prefix }} ] gateway4: {{ network.primary.gateway }} accept-ra: false nameservers: 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 3812e27f..296233f4 100644 --- a/roles/elevate/media/templates/netplan/r3-with-lan.yaml.j2 +++ b/roles/elevate/media/templates/netplan/r3-with-lan.yaml.j2 @@ -3,7 +3,7 @@ network: renderer: networkd ethernets: {{ network.primary.name }}: - addresses: [ {{ (network.primary.ip + '/' + network.primary.mask) | ipaddr('address/prefix') }} ] + addresses: [ {{ network.primary.prefix }} ] accept-ra: false vlans: {{ network.primary.name }}.{{ network_zones.ccinet.vlan }}: diff --git a/roles/installer/debian/preseed/tasks/main.yml b/roles/installer/debian/preseed/tasks/main.yml index aa71335e..46d6a1d9 100644 --- a/roles/installer/debian/preseed/tasks/main.yml +++ b/roles/installer/debian/preseed/tasks/main.yml @@ -29,6 +29,9 @@ copy: dest: "{{ preseed_tmpdir }}/etc/systemd/network/90-namepolicy.link" content: | + [Match] + OriginalName=* + [Link] NamePolicy={{ preseed_force_net_ifnames_policy }} 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 b92aa1eb..ca4cc37e 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 @@ -16,8 +16,8 @@ d-i netcfg/disable_autoconfig boolean false {% else %} d-i netcfg/disable_dhcp boolean true d-i netcfg/disable_autoconfig boolean true -d-i netcfg/get_ipaddress string {{ hostvars[install_hostname].network_cooked.primary.ip }} -d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.mask }} +d-i netcfg/get_ipaddress string {{ hostvars[install_hostname].network_cooked.primary.prefix | ipaddr('address') }} +d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.prefix | ipaddr('netmask') }} d-i netcfg/get_gateway string {{ hostvars[install_hostname].network_cooked.primary.gateway }} d-i netcfg/get_nameservers string {{ hostvars[install_hostname].network_cooked.nameservers | join(' ') }} d-i netcfg/confirm_static boolean true 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 dd0aa0ab..5b7e12e9 100644 --- a/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2 @@ -16,8 +16,8 @@ d-i netcfg/disable_autoconfig boolean false {% else %} d-i netcfg/disable_dhcp boolean true d-i netcfg/disable_autoconfig boolean true -d-i netcfg/get_ipaddress string {{ hostvars[install_hostname].network_cooked.primary.ip }} -d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.mask }} +d-i netcfg/get_ipaddress string {{ hostvars[install_hostname].network_cooked.primary.prefix | ipaddr('address') }} +d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.prefix | ipaddr('netmask') }} d-i netcfg/get_gateway string {{ hostvars[install_hostname].network_cooked.primary.gateway }} d-i netcfg/get_nameservers string {{ hostvars[install_hostname].network_cooked.nameservers | join(' ') }} d-i netcfg/confirm_static boolean true @@ -135,7 +135,10 @@ d-i preseed/late_command string \ in-target bash -c "sed -e 's/^allow-hotplug/auto/' -i /etc/network/interfaces"; \ {% if preseed_force_net_ifnames_policy is defined %} mkdir -p /target/etc/systemd/network; \ - in-target bash -c "echo '[Link]' > /etc/systemd/network/90-namepolicy.link"; \ + in-target bash -c "echo '[Match]' > /etc/systemd/network/90-namepolicy.link"; \ + in-target bash -c "echo 'OriginalName=*' >> /etc/systemd/network/90-namepolicy.link"; \ + in-target bash -c "echo '' >> /etc/systemd/network/90-namepolicy.link"; \ + in-target bash -c "echo '[Link]' >> /etc/systemd/network/90-namepolicy.link"; \ in-target bash -c "echo 'NamePolicy={{ preseed_force_net_ifnames_policy }}' >> /etc/systemd/network/90-namepolicy.link"; \ in-target bash -c "update-initramfs -u"; \ {% endif %} 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 453349db..f4448dbd 100644 --- a/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2 @@ -16,8 +16,8 @@ d-i netcfg/disable_autoconfig boolean false {% else %} d-i netcfg/disable_dhcp boolean true d-i netcfg/disable_autoconfig boolean true -d-i netcfg/get_ipaddress string {{ hostvars[install_hostname].network_cooked.primary.ip }} -d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.mask }} +d-i netcfg/get_ipaddress string {{ hostvars[install_hostname].network_cooked.primary.prefix | ipaddr('address') }} +d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.prefix | ipaddr('netmask') }} d-i netcfg/get_gateway string {{ hostvars[install_hostname].network_cooked.primary.gateway }} d-i netcfg/get_nameservers string {{ hostvars[install_hostname].network_cooked.nameservers | join(' ') }} d-i netcfg/confirm_static boolean true 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 da33c0f5..0896c569 100644 --- a/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2 @@ -16,8 +16,8 @@ d-i netcfg/disable_autoconfig boolean false {% else %} d-i netcfg/disable_dhcp boolean true d-i netcfg/disable_autoconfig boolean true -d-i netcfg/get_ipaddress string {{ hostvars[install_hostname].network_cooked.primary.ip }} -d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.mask }} +d-i netcfg/get_ipaddress string {{ hostvars[install_hostname].network_cooked.primary.prefix | ipaddr('address') }} +d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.prefix | ipaddr('netmask') }} d-i netcfg/get_gateway string {{ hostvars[install_hostname].network_cooked.primary.gateway }} d-i netcfg/get_nameservers string {{ hostvars[install_hostname].network_cooked.nameservers | join(' ') }} d-i netcfg/confirm_static boolean true 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 ab18b8a2..df3b6e90 100644 --- a/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2 @@ -23,8 +23,8 @@ d-i netcfg/disable_autoconfig boolean false {% else %} d-i netcfg/disable_dhcp boolean true d-i netcfg/disable_autoconfig boolean true -d-i netcfg/get_ipaddress string {{ hostvars[install_hostname].network_cooked.primary.ip }} -d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.mask }} +d-i netcfg/get_ipaddress string {{ hostvars[install_hostname].network_cooked.primary.prefix | ipaddr('address') }} +d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.prefix | ipaddr('netmask') }} d-i netcfg/get_gateway string {{ hostvars[install_hostname].network_cooked.primary.gateway }} d-i netcfg/get_nameservers string {{ hostvars[install_hostname].network_cooked.nameservers | join(' ') }} d-i netcfg/confirm_static boolean true 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 33cf0738..4b13133c 100644 --- a/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2 @@ -23,8 +23,8 @@ d-i netcfg/disable_autoconfig boolean false {% else %} d-i netcfg/disable_dhcp boolean true d-i netcfg/disable_autoconfig boolean true -d-i netcfg/get_ipaddress string {{ hostvars[install_hostname].network_cooked.primary.ip }} -d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.mask }} +d-i netcfg/get_ipaddress string {{ hostvars[install_hostname].network_cooked.primary.prefix | ipaddr('address') }} +d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.prefix | ipaddr('netmask') }} d-i netcfg/get_gateway string {{ hostvars[install_hostname].network_cooked.primary.gateway }} d-i netcfg/get_nameservers string {{ hostvars[install_hostname].network_cooked.nameservers | join(' ') }} d-i netcfg/confirm_static boolean true @@ -152,7 +152,10 @@ d-i preseed/late_command string \ in-target bash -c "sed -e 's/^allow-hotplug/auto/' -i /etc/network/interfaces"; \ {% if preseed_force_net_ifnames_policy is defined %} mkdir -p /target/etc/systemd/network; \ - in-target bash -c "echo '[Link]' > /etc/systemd/network/90-namepolicy.link"; \ + in-target bash -c "echo '[Match]' > /etc/systemd/network/90-namepolicy.link"; \ + in-target bash -c "echo 'OriginalName=*' >> /etc/systemd/network/90-namepolicy.link"; \ + in-target bash -c "echo '' >> /etc/systemd/network/90-namepolicy.link"; \ + in-target bash -c "echo '[Link]' >> /etc/systemd/network/90-namepolicy.link"; \ in-target bash -c "echo 'NamePolicy={{ preseed_force_net_ifnames_policy }}' >> /etc/systemd/network/90-namepolicy.link"; \ in-target bash -c "update-initramfs -u"; \ {% endif %} 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 b86d7523..d84ab9a6 100644 --- a/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2 @@ -20,8 +20,8 @@ d-i netcfg/disable_autoconfig boolean false {% else %} d-i netcfg/disable_dhcp boolean true d-i netcfg/disable_autoconfig boolean true -d-i netcfg/get_ipaddress string {{ hostvars[install_hostname].network_cooked.primary.ip }} -d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.mask }} +d-i netcfg/get_ipaddress string {{ hostvars[install_hostname].network_cooked.primary.prefix | ipaddr('address') }} +d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.prefix | ipaddr('netmask') }} d-i netcfg/get_gateway string {{ hostvars[install_hostname].network_cooked.primary.gateway }} d-i netcfg/get_nameservers string {{ hostvars[install_hostname].network_cooked.nameservers | join(' ') }} d-i netcfg/confirm_static boolean true 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 e20825bf..02efc018 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 @@ -26,8 +26,8 @@ d-i netcfg/disable_autoconfig boolean false {% else %} d-i netcfg/disable_dhcp boolean true d-i netcfg/disable_autoconfig boolean true -d-i netcfg/get_ipaddress string {{ hostvars[install_hostname].network_cooked.primary.ip }} -d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.mask }} +d-i netcfg/get_ipaddress string {{ hostvars[install_hostname].network_cooked.primary.prefix | ipaddr('address') }} +d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.prefix | ipaddr('netmask') }} d-i netcfg/get_gateway string {{ hostvars[install_hostname].network_cooked.primary.gateway }} d-i netcfg/get_nameservers string {{ hostvars[install_hostname].network_cooked.nameservers | join(' ') }} d-i netcfg/confirm_static boolean true diff --git a/roles/installer/openbsd/autoinstall/templates/auto_install.conf.j2 b/roles/installer/openbsd/autoinstall/templates/auto_install.conf.j2 index 6989d7e0..cf15baff 100644 --- a/roles/installer/openbsd/autoinstall/templates/auto_install.conf.j2 +++ b/roles/installer/openbsd/autoinstall/templates/auto_install.conf.j2 @@ -4,8 +4,8 @@ Which network interface do you wish to configure = {{ install_interface | defaul {% if 'install_dhcp' in hostvars[install_hostname] and hostvars[install_hostname].install_dhcp %} IPv4 address = dhcp {% else %} -IPv4 address = {{ hostvars[install_hostname].network_cooked.primary.ip }} -Netmask = {{ hostvars[install_hostname].network_cooked.primary.mask }} +IPv4 address = {{ hostvars[install_hostname].network_cooked.primary.prefix | ipaddr('address') }} +Netmask = {{ hostvars[install_hostname].network_cooked.primary.prefix | ipaddr('netmask') }} Default IPv4 route = {{ hostvars[install_hostname].network_cooked.primary.gateway }} {% endif %} DNS domain name = {{ hostvars[install_hostname].network_cooked.domain }} diff --git a/roles/vm/network/templates/interfaces.j2 b/roles/vm/network/templates/interfaces.j2 index 3c151144..70edb1dd 100644 --- a/roles/vm/network/templates/interfaces.j2 +++ b/roles/vm/network/templates/interfaces.j2 @@ -13,8 +13,8 @@ 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 {{ interface.ip }} - netmask {{ interface.mask }} + address {{ interface.prefix | ipaddr('address') }} + netmask {{ interface.prefix | ipaddr('netmask') }} {% if 'overlay' in interface %} up /bin/ip addr add dev $IFACE {{ interface.overlay }}/32 {% if 'gateway' in interface %} -- cgit v1.2.3 From b22cd6a4d9d93376631f8417b01035fd4f9af4f0 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 22 Jun 2020 01:35:29 +0200 Subject: converted other physical machines to new network config --- inventory/host_vars/ch-equinox-ws.yml | 2 +- inventory/host_vars/ele-calypso.yml | 9 +++++---- inventory/host_vars/ele-dione.yml | 9 +++++---- inventory/host_vars/ele-helene.yml | 9 +++++---- inventory/host_vars/ele-media.yml | 9 +++++---- inventory/host_vars/ele-telesto.yml | 9 +++++---- inventory/host_vars/ele-thetys.yml | 9 +++++---- inventory/host_vars/ele-uhrturm.yml | 9 +++++---- inventory/host_vars/lw-dione.yml | 9 +++++---- inventory/host_vars/lw-helene.yml | 9 +++++---- inventory/host_vars/lw-telesto.yml | 9 +++++---- inventory/host_vars/lw-thetys.yml | 14 ++++++++------ 12 files changed, 59 insertions(+), 47 deletions(-) (limited to 'inventory/host_vars/ch-equinox-ws.yml') diff --git a/inventory/host_vars/ch-equinox-ws.yml b/inventory/host_vars/ch-equinox-ws.yml index fb1da511..6d454f57 100644 --- a/inventory/host_vars/ch-equinox-ws.yml +++ b/inventory/host_vars/ch-equinox-ws.yml @@ -11,7 +11,7 @@ network: domain: "{{ host_domain }}" primary: &_network_primary_ name: enp8s0 - prefix: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address/prefix') }}" + address: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address/prefix') }}" gateway: "{{ network_zones.lan.gateway }}" interfaces: - *_network_primary_ diff --git a/inventory/host_vars/ele-calypso.yml b/inventory/host_vars/ele-calypso.yml index 7ffdd701..865bcebb 100644 --- a/inventory/host_vars/ele-calypso.yml +++ b/inventory/host_vars/ele-calypso.yml @@ -6,8 +6,9 @@ install: {} network: nameservers: "{{ network_zones.lan.dns }}" domain: "{{ host_domain }}" - primary: - interface: eno1 - ip: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address') }}" - mask: "{{ network_zones.lan.prefix | ipaddr('netmask') }}" + primary: &_network_primary_ + name: eno1 + address: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address/prefix') }}" gateway: "{{ network_zones.lan.gateway }}" + interfaces: + - *_network_primary_ diff --git a/inventory/host_vars/ele-dione.yml b/inventory/host_vars/ele-dione.yml index 368ac94a..233fc9e8 100644 --- a/inventory/host_vars/ele-dione.yml +++ b/inventory/host_vars/ele-dione.yml @@ -10,11 +10,12 @@ install: network: nameservers: "{{ network_zones.lan.dns }}" domain: spreadspace.org - primary: - interface: eno1 - ip: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address') }}" - mask: "{{ network_zones.lan.prefix | ipaddr('netmask') }}" + primary: &_network_primary_ + name: eno1 + address: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address/prefix') }}" gateway: "{{ network_zones.lan.gateway }}" + interfaces: + - *_network_primary_ base_packages_extra_host: - exfat-fuse diff --git a/inventory/host_vars/ele-helene.yml b/inventory/host_vars/ele-helene.yml index b5b74ff2..a28eccf2 100644 --- a/inventory/host_vars/ele-helene.yml +++ b/inventory/host_vars/ele-helene.yml @@ -10,11 +10,12 @@ install: network: nameservers: "{{ network_zones.lan.dns }}" domain: spreadspace.org - primary: - interface: eno1 - ip: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address') }}" - mask: "{{ network_zones.lan.prefix | ipaddr('netmask') }}" + primary: &_network_primary_ + name: eno1 + address: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address/prefix') }}" gateway: "{{ network_zones.lan.gateway }}" + interfaces: + - *_network_primary_ base_packages_extra_host: - exfat-fuse diff --git a/inventory/host_vars/ele-media.yml b/inventory/host_vars/ele-media.yml index bf638639..b61ef79e 100644 --- a/inventory/host_vars/ele-media.yml +++ b/inventory/host_vars/ele-media.yml @@ -6,11 +6,12 @@ install: network: nameservers: "{{ network_zones.lan.dns }}" domain: "{{ host_domain }}" - primary: - interface: eno1 - ip: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address') }}" - mask: "{{ network_zones.lan.prefix | ipaddr('netmask') }}" + primary: &_network_primary_ + name: eno1 + address: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address/prefix') }}" gateway: "{{ network_zones.lan.gateway }}" + interfaces: + - *_network_primary_ network_setup: elevate-festival diff --git a/inventory/host_vars/ele-telesto.yml b/inventory/host_vars/ele-telesto.yml index 7ac794a5..a8b2b162 100644 --- a/inventory/host_vars/ele-telesto.yml +++ b/inventory/host_vars/ele-telesto.yml @@ -8,11 +8,12 @@ install: {} network: nameservers: "{{ network_zones.lan.dns }}" domain: "{{ host_domain }}" - primary: - interface: eno1 - ip: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address') }}" - mask: "{{ network_zones.lan.prefix | ipaddr('netmask') }}" + primary: &_network_primary_ + name: eno1 + address: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address/prefix') }}" gateway: "{{ network_zones.lan.gateway }}" + interfaces: + - *_network_primary_ admin_users_host: - equinox diff --git a/inventory/host_vars/ele-thetys.yml b/inventory/host_vars/ele-thetys.yml index 5748333f..2d6bee1d 100644 --- a/inventory/host_vars/ele-thetys.yml +++ b/inventory/host_vars/ele-thetys.yml @@ -9,11 +9,12 @@ install: network: nameservers: "{{ network_zones.lan.dns }}" domain: "{{ host_domain }}" - primary: - interface: eno1 - ip: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address') }}" - mask: "{{ network_zones.lan.prefix | ipaddr('netmask') }}" + primary: &_network_primary_ + name: eno1 + address: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address/prefix') }}" gateway: "{{ network_zones.lan.gateway }}" + interfaces: + - *_network_primary_ admin_users_host: - equinox diff --git a/inventory/host_vars/ele-uhrturm.yml b/inventory/host_vars/ele-uhrturm.yml index ad0056b0..71c312cc 100644 --- a/inventory/host_vars/ele-uhrturm.yml +++ b/inventory/host_vars/ele-uhrturm.yml @@ -6,11 +6,12 @@ install: network: nameservers: "{{ network_zones.lan.dns }}" domain: "{{ host_domain }}" - primary: - interface: eno1 - ip: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address') }}" - mask: "{{ network_zones.lan.prefix | ipaddr('netmask') }}" + primary: &_network_primary_ + name: eno1 + address: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address/prefix') }}" gateway: "{{ network_zones.lan.gateway }}" + interfaces: + - *_network_primary_ ssh_users_root: - equinox diff --git a/inventory/host_vars/lw-dione.yml b/inventory/host_vars/lw-dione.yml index 19b44ff4..02738ee6 100644 --- a/inventory/host_vars/lw-dione.yml +++ b/inventory/host_vars/lw-dione.yml @@ -11,11 +11,12 @@ network: nameservers: - 9.9.9.9 domain: "{{ host_domain }}" - primary: - interface: eno1 - ip: 192.168.32.202 - mask: 255.255.255.0 + primary: &_network_primary_ + name: eno1 + address: 192.168.32.202/24 gateway: 192.168.32.254 + interfaces: + - *_network_primary_ base_packages_extra_host: - exfat-fuse diff --git a/inventory/host_vars/lw-helene.yml b/inventory/host_vars/lw-helene.yml index c5a936d5..e7919ac7 100644 --- a/inventory/host_vars/lw-helene.yml +++ b/inventory/host_vars/lw-helene.yml @@ -11,11 +11,12 @@ network: nameservers: - 9.9.9.9 domain: "{{ host_domain }}" - primary: - interface: eno1 - ip: 192.168.32.203 - mask: 255.255.255.0 + primary: &_network_primary_ + name: eno1 + address: 192.168.32.203/24 gateway: 192.168.32.254 + interfaces: + - *_network_primary_ base_packages_extra_host: - exfat-fuse diff --git a/inventory/host_vars/lw-telesto.yml b/inventory/host_vars/lw-telesto.yml index f25ad258..4a10338e 100644 --- a/inventory/host_vars/lw-telesto.yml +++ b/inventory/host_vars/lw-telesto.yml @@ -9,11 +9,12 @@ network: nameservers: - 9.9.9.9 domain: "{{ host_domain }}" - primary: - interface: eno1 - ip: 192.168.32.201 - mask: 255.255.255.0 + primary: &_network_primary_ + name: eno1 + address: 192.168.32.201/24 gateway: 192.168.32.254 + interfaces: + - *_network_primary_ admin_users_host: - equinox diff --git a/inventory/host_vars/lw-thetys.yml b/inventory/host_vars/lw-thetys.yml index 75aa41f0..17b057b2 100644 --- a/inventory/host_vars/lw-thetys.yml +++ b/inventory/host_vars/lw-thetys.yml @@ -7,13 +7,15 @@ install: - "consoleblank=0" network: - nameservers: "9.9.9.9" + nameservers: + - 9.9.9.9 domain: "{{ host_domain }}" - primary: - interface: eno1 - ip: "192.168.28.202" - mask: "255.255.255.0" - gateway: "192.168.28.254" + primary: &_network_primary_ + name: eno1 + address: 192.168.28.202/24 + gateway: 192.168.28.254 + interfaces: + - *_network_primary_ admin_users_host: - equinox -- cgit v1.2.3