title: filter data From ansible_default_ipv4.macaddress
body: <p>Dear community i ask for your help please.</p>
  <p>I would create a playbook that will take a macaddress given in input and it should respect the <code>Unix</code> format. Then, if the address given respects the required format, another task will check if the given macaddress match an existed one in the hosts, **if it exists it will show <code>the interface related to that macaddress</code> if not the task will fail with an error message <code>&quot;No interfaces found with mac address '$MACADDRESS'. Fatal error.&quot;</code></p>
  <p>here is what was done by me, i don't what should be done to achieve the goal:</p>
  <pre><code>- hosts: all
    gather_facts: no
    vars_prompt:
      - name: &quot;MACADDRESS&quot;
        prompt: &quot;mac address?(please use Unix format ex- 1a:2b:3c:4d:5e:6f )&quot;
        private: no
  
  
    tasks:
      - name: check macaddresssyntax
        debug:
          msg: &quot;{{ MACADDRESS | ansible.utils.hwaddr('unix') }}&quot;
        register: mac_syntax
        failed_when: mac_syntax failed
  
  
      - name: check local mac
        debug:
          var: mac_syntax |intersect (ansible_facts['default_ipv4']|selectattr('macaddress') | map(attribute='interface')|list)
  
  </code></pre>