diff options
author | Markos Chandras <mchandras@suse.de> | 2018-04-25 15:55:10 +0100 |
---|---|---|
committer | Markos Chandras <mchandras@suse.de> | 2018-04-30 16:09:19 +0100 |
commit | 15be5eb8da9881428ea1635a3184c39f63dfaf80 (patch) | |
tree | 7e46c3fc275e1ee8222568087999a89bcd153567 /xci/playbooks/roles/bootstrap-host/templates/osa/debian.interface.j2 | |
parent | be67faf1cfaeb2f0d1ff73c90c8b3996b2b6a506 (diff) |
xci: roles: bootstrap-host: Simplify configuration files
We split the networking task on distro specific files to make it
easier to read. Moreover, the debian network configuration has been
improved by simply sharing a common file across all nodes and also
use the 'source' facility in the main /etc/network/interfaces file
to use one configuration file per interface.
Change-Id: Ic822fe6dc197227e70c0ba7cee812629df287d82
Signed-off-by: Markos Chandras <mchandras@suse.de>
Diffstat (limited to 'xci/playbooks/roles/bootstrap-host/templates/osa/debian.interface.j2')
-rw-r--r-- | xci/playbooks/roles/bootstrap-host/templates/osa/debian.interface.j2 | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/xci/playbooks/roles/bootstrap-host/templates/osa/debian.interface.j2 b/xci/playbooks/roles/bootstrap-host/templates/osa/debian.interface.j2 new file mode 100644 index 00000000..56db509b --- /dev/null +++ b/xci/playbooks/roles/bootstrap-host/templates/osa/debian.interface.j2 @@ -0,0 +1,38 @@ +# {{ ansible_managed }} + +# Physical interface +{% if item.bridge_ports is not defined %} +auto {{ item.name }} +iface {{ item.name }} inet manual +{% if item.vlan_id is defined %} + vlan-raw-device {{ item.name|replace('.' ~ item.vlan_id, '') }} +{% endif %} + +{% else %} +auto {{ item.name }} +iface {{ item.name }} inet static + bridge_stp off + bridge_waitport 0 + bridge_fd 0 + bridge_ports {{ item.bridge_ports }} +{% if item.name == 'br-vlan' %} + # Create veth pair, don't bomb if already exists + pre-up ip link add br-vlan-veth type veth peer name eth12 || true + # Set both ends UP + pre-up ip link set br-vlan-veth up + pre-up ip link set eth12 up + # Delete veth pair on DOWN + post-down ip link del br-vlan-veth || true + bridge_ports br-vlan-veth +{% endif %} +{% if item.ip is defined %} + address {{ item.ip }} +{% endif %} +{% if item.prefix is defined %} + netmask {{ item.prefix }} +{% endif %} +{% if item.gateway is defined %} + gateway {{ item.gateway }} +{% endif %} + +{% endif %} |