foo/mac2eui64_test.yaml

24 lines
676 B
YAML

- name: Test the mac2eui64 filter plugin
hosts: localhost
connection: local
gather_facts: false
vars:
addr: "2001:db8::"
macs:
- mac: 30:b5:c2:fb:82:6b
eui64: 2001:db8::32b5:c2ff:fefb:826b
- mac: 30:b5:c2:b2:76:3a
eui64: 2001:db8::32b5:c2ff:feb2:763a
tasks:
- name: Convert MACs to EUI64 addresses
set_fact:
eui64: "{{ addr | ipmath(item['mac'] | mac2eui64) }}"
with_list: "{{ macs }}"
register: eui64_list
- name: Match first block of results
debug: var=item.ansible_facts.eui64
with_items: "{{ eui64_list.results }}"
failed_when: item.ansible_facts.eui64 != item.item.eui64