From 7c45217e1c499dc0e3d35048bf4939235d46153e Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 22 Jul 2022 14:31:14 +0200 Subject: ele-calypso: add temporary workaround for network config --- dan/ele-calypso.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'dan/ele-calypso.yml') diff --git a/dan/ele-calypso.yml b/dan/ele-calypso.yml index c7d1e6c4..07dd5a6d 100644 --- a/dan/ele-calypso.yml +++ b/dan/ele-calypso.yml @@ -37,3 +37,26 @@ proxy_pass: "http://127.0.0.1:9090" '/alertmanager/': proxy_pass: "http://127.0.0.1:9093" + post_tasks: + ## TODO: move to network/interfaces when this is done + - name: install vlan interfaces + loop: "{{ network.vlans | dict2items }}" + loop_control: + label: "{{ item.key }} ({{ item.value | join(',') }})" + copy: + dest: "/etc/network/interfaces.d/{{ item.key }}" + content: | + auto {{ item.key }} + iface {{ item.key }} inet manual + {% for vlan in item.value %} + {% set vlan_ifname = item.key + '.' + (vlan | string) %} + {% set vlan_iface = (network.interfaces | selectattr('name', 'eq', vlan_ifname)) %} + + auto {{ vlan_ifname }} + {% if vlan_iface %} + iface {{ vlan_ifname }} inet static + address {{ (vlan_iface | first).address }} + {% else %} + iface {{ vlan_ifname }} inet manual + {% endif %} + {% endfor %} -- cgit v1.2.3