From 23867d487ab86bf9feb0817c365698c051abc213 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 5 Jun 2018 00:45:23 +0200 Subject: [PATCH] ansible: add global network config --- ansible/group_vars/all/network.yml | 29 +++++++++++++++++++++++++++++ ansible/host_vars/torwaechter/main.yml | 10 +++++----- 2 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 ansible/group_vars/all/network.yml diff --git a/ansible/group_vars/all/network.yml b/ansible/group_vars/all/network.yml new file mode 100644 index 0000000..a8fc409 --- /dev/null +++ b/ansible/group_vars/all/network.yml @@ -0,0 +1,29 @@ +--- +net: + mgmt: + vlan: 32 + prefix: 192.168.32.0/24 + gw: 192.168.32.254 + dns: + - 192.168.32.254 + offsets: + switches: 200 + accesspoints: 220 + + iot: + vlan: 33 + prefix: 192.168.33.0/24 + gw: 192.168.33.254 + dns: + - 192.168.33.254 + + lan: + vlan: 127 + prefix: 192.168.127.0/24 + gw: 192.168.127.254 + dns: + - 192.168.127.254 + + ff: + vlan: 255 + prefix: 10.12.240.240/28 diff --git a/ansible/host_vars/torwaechter/main.yml b/ansible/host_vars/torwaechter/main.yml index f50f8f9..926b903 100644 --- a/ansible/host_vars/torwaechter/main.yml +++ b/ansible/host_vars/torwaechter/main.yml @@ -100,15 +100,15 @@ openwrt_uci: ipaddr: 127.0.0.1 netmask: 255.0.0.0 - - name: interface 'lan' + - name: interface 'mgmt' options: ifname: eth0 accept_ra: 0 proto: static - ipaddr: 192.168.32.100 - netmask: 255.255.255.0 - gateway: 192.168.32.254 - dns: 192.168.32.254 + ipaddr: "{{ net.mgmt.prefix | ipaddr(100) | ipaddr('address') }}" + netmask: "{{ net.mgmt.prefix | ipaddr('netmask') }}" + gateway: "{{ net.mgmt.gw }}" + dns: "{{ net.mgmt.dns | join(' ') }}" dns_search: realraum.at -- 1.7.10.4