Merge "Ensure veths are only 15 characters long"

This commit is contained in:
Jenkins 2016-09-12 20:01:24 +00:00 committed by Gerrit Code Review
commit d68b9c91b9
3 changed files with 4 additions and 2 deletions

View File

@ -102,3 +102,5 @@ lxc_container_download_template_options: >
# Toggle the restart of containers via the handler.
lxc_container_allow_restarts: yes
lxc_container_network_veth_pair: "{{ inventory_hostname[-8:].replace('-', '').replace('_', '') }}_{{ item.value.interface }}"

View File

@ -251,7 +251,7 @@
shell: >
/usr/local/bin/lxc-veth-wiring
"{{ inventory_hostname }}"
"{{ inventory_hostname[-8:].replace('-', '').replace('_', '') }}_{{ item.value.interface }}"
"{{ lxc_container_network_veth_pair[-15:] }}"
"{{ item.value.interface }}"
"{{ item.value.bridge }}"
register: wiring_script

View File

@ -8,7 +8,7 @@ lxc.network.name = {{ item.value.interface }}
# Name the veth after the container
# NOTE(major): The lxc.network.veth.pair line must appear right after
# lxc.network.name or it will be ignored.
lxc.network.veth.pair = {{ inventory_hostname[-8:].replace('-', '').replace('_', '') }}_{{ item.value.interface }}
lxc.network.veth.pair = {{ lxc_container_network_veth_pair[-15:] }}
{% endif %}
# Host link to attach to, this should be a bridge if lxc.network.type = veth
lxc.network.link = {{ item.value.bridge }}