ansible: add global network config
authorChristian Pointner <equinox@realraum.at>
Mon, 4 Jun 2018 22:45:23 +0000 (00:45 +0200)
committerChristian Pointner <equinox@realraum.at>
Sat, 7 Jul 2018 22:11:36 +0000 (00:11 +0200)
ansible/group_vars/all/network.yml [new file with mode: 0644]
ansible/host_vars/torwaechter/main.yml

diff --git a/ansible/group_vars/all/network.yml b/ansible/group_vars/all/network.yml
new file mode 100644 (file)
index 0000000..a8fc409
--- /dev/null
@@ -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
index f50f8f9..926b903 100644 (file)
@@ -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