summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2019-06-29 06:11:02 +0200
committerChristian Pointner <equinox@spreadspace.org>2019-06-29 06:11:02 +0200
commit33c0e6465821dc0377bb11c841fb244b9b3b924b (patch)
tree41612ba88476e6d17e97e15a286def8e1bddf212
parentgnocchi base install works now (diff)
added interface config generator for gnocci
-rw-r--r--chaos-at-home/ch-gnocchi.yml3
-rw-r--r--inventory/host_vars/ch-gnocchi.yml61
-rw-r--r--roles/vm/host/tasks/main.yml1
3 files changed, 54 insertions, 11 deletions
diff --git a/chaos-at-home/ch-gnocchi.yml b/chaos-at-home/ch-gnocchi.yml
index 01000c1d..751ec65a 100644
--- a/chaos-at-home/ch-gnocchi.yml
+++ b/chaos-at-home/ch-gnocchi.yml
@@ -6,3 +6,6 @@
- role: sshd
- role: zsh
- role: vm/host
+ post_tasks:
+ - pause:
+ prompt: "{{ __interface_configs__ }}"
diff --git a/inventory/host_vars/ch-gnocchi.yml b/inventory/host_vars/ch-gnocchi.yml
index 73251d15..04217417 100644
--- a/inventory/host_vars/ch-gnocchi.yml
+++ b/inventory/host_vars/ch-gnocchi.yml
@@ -1,17 +1,6 @@
---
install_interface: enp2s0
install_dhcp: true
-##
-##
-# /etc/network/interfaces.d/enp3s0: |
-# auto enp3s0
-# iface enp3s0 inet manual
-#
-# auto enp3s0.{{ network_zones.mgmt.vlan }}
-# iface enp3s0.{{ network_zones.mgmt.vlan }} inet static
-# address {{ network_zones.mgmt.prefix | ipaddr(network_zones.mgmt.offsets[inventory_hostname]) | ipaddr('address') }}
-# netmask {{ network_zones.mgmt.prefix | ipaddr('netmask') }}
-#
install:
disks:
@@ -21,3 +10,53 @@ install:
network:
domain: spreadspace.org
+
+
+
+__interfaces__:
+ enp1s0:
+ zones:
+ lan:
+ type: manual
+ svc:
+ type: manual
+ enp2s0:
+ zones:
+ magenta:
+ type: manual
+ enp3s0:
+ zones:
+ mgmt:
+ type: static
+ address: "{{ network_zones.mgmt.prefix | ipaddr(network_zones.mgmt.offsets[inventory_hostname]) | ipaddr('address') }}"
+ netmask: "{{ network_zones.mgmt.prefix | ipaddr('netmask') }}"
+ iot:
+ type: manual
+
+
+__interface_configs__: |
+ {% for interface in __interfaces__.keys() %}
+ ##
+ ## /etc/network/interfaces.d/{{ interface }}
+ ##
+ auto {{ interface }}
+ iface {{ interface }} inet manual
+
+ {% for zone in __interfaces__[interface].zones.keys() %}
+
+ auto {{ interface }}.{{ network_zones[zone].vlan }}
+ iface {{ interface }}.{{ network_zones[zone].vlan }} inet manual
+
+ auto br-{{ zone }}
+ iface br-{{ zone }} inet {{ __interfaces__[interface].zones[zone].type }}
+ bridge_ports {{ interface }}.{{ network_zones[zone].vlan }}
+ bridge_stp off
+ bridge_waitport 0
+ bridge_fd 0
+ {% if __interfaces__[interface].zones[zone].type == 'static' %}
+ address {{ __interfaces__[interface].zones[zone].address }}
+ netmask {{ __interfaces__[interface].zones[zone].netmask }}
+ {% endif %}
+
+ {% endfor %}
+ {% endfor %}
diff --git a/roles/vm/host/tasks/main.yml b/roles/vm/host/tasks/main.yml
index 562e502e..6a966464 100644
--- a/roles/vm/host/tasks/main.yml
+++ b/roles/vm/host/tasks/main.yml
@@ -7,6 +7,7 @@
libvirt-daemon-system
- python-libvirt
- haveged
+ - bridge-utils
state: present
- name: configure haveged