789aaa4e73
The veth_pair name was partially configurable, however eth0's veth pair naming scheme was hard coded. This change accomplishes: - veth pair prefix templating is now consistent across all interfaces generated by the role. - no change is made to the default configuration of veth pair naming, it only allows more reusability of the role by allowing the veth pair naming to be configured by the role's consumers. - eth0 veth pair naming scheme can be configured just as other interfaces could be before. Change-Id: I47004126cab85043f623aee8262151d3b53238e9
16 lines
662 B
Django/Jinja
16 lines
662 B
Django/Jinja
#!/usr/bin/env bash
|
|
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
|
|
|
# LXC eth0 is considered special and not managed by the base container_networks
|
|
# data structure. This is being added outside of the loop for this reason.
|
|
ip link del {{ lxc_container_network_veth_pair_prefix }}_eth0 || true
|
|
|
|
# Veth cleanup for items in the container_networks data structure
|
|
{% if container_networks is defined %}
|
|
{% for key, value in container_networks.items() %}
|
|
{% if value.type is not defined or value.type == 'veth' %}
|
|
ip link del {{ lxc_container_network_veth_pair_prefix }}_{{ value.interface }} || true
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endif %}
|