vlan Bug-Fix
Change-Id: Ia7716c790035e81d4c3503cc026a8b61b46ecf12
diff --git a/playbooks/roles/configure-targethosts/tasks/configure-network-Debian.yml b/playbooks/roles/configure-targethosts/tasks/configure-network-Debian.yml
index aac29aa..d7c87a6 100644
--- a/playbooks/roles/configure-targethosts/tasks/configure-network-Debian.yml
+++ b/playbooks/roles/configure-targethosts/tasks/configure-network-Debian.yml
@@ -53,10 +53,11 @@
set_fact:
device_mac_dict: "{{ (device_mac_dict | default({})) | combine({item.macaddress: item.device}) }}"
loop: "{{ ansible_interfaces | map('regex_replace', '-', '_') | map('regex_replace', '^', 'ansible_') | map('extract', hostvars[inventory_hostname]) | selectattr('macaddress','defined') | list }}"
+ when: "{{ '.' not in item.device }}"
-- name: Compute mapping dict from mac address to interface name (device name with/without VLAN info)
+- name: Filter to include only configured ethernet interfaces
set_fact:
- if_mac_dict: "{{ ( if_mac_dict | default({}) ) | combine({item.mac_address: (item.vlan == 'native') | ternary(device_mac_dict[item.mac_address], device_mac_dict[item.mac_address] + '.' + item.vlan) }) }}"
+ if_mac_dict: "{{ ( if_mac_dict | default({}) ) | combine({item.mac_address: device_mac_dict[item.mac_address]}) }}"
loop: "{{ node.interfaces }}"
- name: Configure networking for host