summaryrefslogtreecommitdiff
path: root/roles
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 /roles
parentvm-host: fix in case no bridges are defined (diff)
move to new vm-host network config on ch-atlas
Diffstat (limited to 'roles')
-rw-r--r--roles/vm/host/tasks/network.yml11
1 files changed, 11 insertions, 0 deletions
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