Ansible filter & search facts

Hi guys,

i have a RHEL7 vm with this facts that show the network configi:

[root@****** /etc/ansible]# ansible testserver -m setup -a ‘filter=ansible_eno16777728’
********** | success >> {
“ansible_facts”: {
“ansible_eno16777728”: {
“active”: true,
“device”: “eno16777728”,
“macaddress”: “00:50:56:9d:3e:fe”,
“module”: “e1000”,
“mtu”: 1500,
“promisc”: false,
“type”: “ether”
}
},
“changed”: false
}

Is there a way to obtain the fact “device” that display the network device name from the macaddress?

Somethig like this:

  • name: Print device name know the macaddress
    debug: msg=“UUDI={{ ansible_eno*.device }}”
    when ansible_eno*.macaddress == ‘00:50:56:9d:3e:fe’

Any idea?

Thanks in advance!