I want to use ansible facts to filter the network interfaces where their module is set to igb.
I know that I can run this command and get the network facts for all interfaces. (inc the module for each interface)
ansible -m setup -a 'gather_subset=network' host.so.com
I've tried using these variables below and doing a debug on the variable, hoping to see the names of the interfaces with that module, but i can only get it to output all facts for interfaces with module=ibg instead of just the device name.
allNetworkModules: "{{ ansible_facts | dict2items | selectattr('value.module', 'defined') | map(attribute='value') | list }}"
ixgbe_module: "{{ ansible_facts | dict2items | selectattr('value.module', 'defined') | selectattr('value.module', 'equalto', 'igb') | list }}"
Can anyone tell me how I can filter to just get the interface names please?
Thank you