summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2019-12-22 23:45:12 +0100
committerChristian Pointner <equinox@spreadspace.org>2019-12-22 23:45:12 +0100
commiteef56d2f242eb261fb5a14738fef5846c7b2e5eb (patch)
treef52daddcbf0529bc280cfdcbdf281bf156144786
parentvm-host: fix in case no bridges are defined (diff)
move to new vm-host network config on ch-atlas
-rw-r--r--inventory/host_vars/ch-atlas.yml24
-rw-r--r--roles/vm/host/tasks/network.yml11
2 files changed, 25 insertions, 10 deletions
diff --git a/inventory/host_vars/ch-atlas.yml b/inventory/host_vars/ch-atlas.yml
index a131434a..2316d647 100644
--- a/inventory/host_vars/ch-atlas.yml
+++ b/inventory/host_vars/ch-atlas.yml
@@ -1,14 +1,18 @@
---
vm_host:
network:
- prefix: 89.106.215.29/28
- gw: 89.106.215.30
- prefix6: 2a02:3e0:407::29/64
- gw6: 2a02:3e0:407::1
dns:
- - 89.106.208.7
- - 89.106.208.12
- offsets:
- ch-keyserver: 3
- ch-testvm: 4
- r3-vex2: 11
+ - 89.106.208.7
+ - 89.106.208.12
+ bridges:
+ public:
+ interfaces:
+ - eth0
+ prefix: 89.106.215.29/28
+ gw: 89.106.215.30
+ prefix6: 2a02:3e0:407::29/64
+ gw6: 2a02:3e0:407::1
+ offsets:
+ ch-keyserver: 3
+ ch-testvm: 4
+ r3-vex2: 11
diff --git a/roles/vm/host/tasks/network.yml b/roles/vm/host/tasks/network.yml
index 5db20e3d..db6bf82d 100644
--- a/roles/vm/host/tasks/network.yml
+++ b/roles/vm/host/tasks/network.yml
@@ -14,6 +14,9 @@
iface br-{{ item.key }} inet static
address {{ item.value.prefix | ipaddr('address') }}
netmask {{ item.value.prefix | ipaddr('netmask') }}
+ {% if 'gw' in item.value %}
+ gateway {{ item.value.gw }}
+ {% endif %}
{% else %}
iface br-{{ item.key }} inet manual
{% endif %}
@@ -48,6 +51,14 @@
down /sbin/iptables -t nat -D POSTROUTING -o {{ ansible_default_ipv4.interface }} -s {{ item.value.prefix | ipaddr('network/prefix') }} -j SNAT --to {{ ansible_default_ipv4.address }}
{% endif %}
{% endif %}
+ {% if 'prefix6' in item.value %}
+
+ iface br-{{ item.key }} inet6 static
+ address {{ item.value.prefix6 }}
+ {% if 'gw6' in item.value %}
+ gateway {{ item.value.gw6 }}
+ {% endif %}
+ {% endif %}
register: vmhost_bridge_config
## We don't try to be to clever here: aka don't call ifdown before ifup because