diff options
author | Christian Pointner <equinox@spreadspace.org> | 2019-12-22 23:45:12 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2019-12-22 23:45:12 +0100 |
commit | eef56d2f242eb261fb5a14738fef5846c7b2e5eb (patch) | |
tree | f52daddcbf0529bc280cfdcbdf281bf156144786 /roles/vm/host/tasks/network.yml | |
parent | vm-host: fix in case no bridges are defined (diff) |
move to new vm-host network config on ch-atlas
Diffstat (limited to 'roles/vm/host/tasks/network.yml')
-rw-r--r-- | roles/vm/host/tasks/network.yml | 11 |
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 |