diff --git a/tasks/network-interfaces.yml b/tasks/network-interfaces.yml index ee9191d..68caaed 100644 --- a/tasks/network-interfaces.yml +++ b/tasks/network-interfaces.yml @@ -18,7 +18,7 @@ - name: network-interfaces | Create a dictionary of additional interfaces ansible.builtin.set_fact: new_ints: "[{% for i in ansible_interfaces %}{% if i != ansible_lo.device or i != ansible_default_ipv4.interface %}{{ i }}{% if not loop.last %},{% endif %}{% endif %}{% endfor %}]" - when: net_ints is not defined or net_ints == None or net_ints | length == 0 + when: net_ints is defined and net_ints | length != 0 - name: network-interfaces | Print the additional interfaces ansible.builtin.debug: msg: "Interfaces list: {{ new_ints }}"