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 +-- 4 files changed, 8 insertions(+), 11 deletions(-) (limited to 'inventory') 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: -- cgit v1.2.3