diff --git a/kayobe/plugins/action/kolla_ansible_host_vars.py b/kayobe/plugins/action/kolla_ansible_host_vars.py index d03aac6aa..2a442b760 100644 --- a/kayobe/plugins/action/kolla_ansible_host_vars.py +++ b/kayobe/plugins/action/kolla_ansible_host_vars.py @@ -154,7 +154,10 @@ class ActionModule(ActionBase): # For a bridge, use a veth pair connected to the bridge. Otherwise # use the interface directly. if is_bridge: - external_interface = patch_prefix + interface + patch_suffix + # interface names can't be longer than 15 characters + char_limit = 15 - len(patch_prefix) - len(patch_suffix) + external_interface = patch_prefix + interface[:char_limit] + \ + patch_suffix else: external_interface = interface neutron_external_interfaces.append(external_interface) diff --git a/kayobe/plugins/filter/networks.py b/kayobe/plugins/filter/networks.py index bbcd74407..1d54a8c7b 100644 --- a/kayobe/plugins/filter/networks.py +++ b/kayobe/plugins/filter/networks.py @@ -49,7 +49,10 @@ def _get_veth_interface(context, bridge, inventory_hostname): inventory_hostname) suffix = utils.get_hostvar(context, 'network_patch_suffix_phy', inventory_hostname) - return prefix + bridge + suffix + + # interface names can't be longer than 15 characters + char_limit = 15 - len(prefix) - len(suffix) + return prefix + bridge[:char_limit] + suffix def _get_veth_peer(context, bridge, inventory_hostname): @@ -64,7 +67,10 @@ def _get_veth_peer(context, bridge, inventory_hostname): inventory_hostname) suffix = utils.get_hostvar(context, 'network_patch_suffix_ovs', inventory_hostname) - return prefix + bridge + suffix + + # interface names can't be longer than 15 characters + char_limit = 15 - len(prefix) - len(suffix) + return prefix + bridge[:char_limit] + suffix def get_ovs_veths(context, names, inventory_hostname):