I’m having a problem Docker interface problems while getting a list of interfaces. People on here helped me get the list of interfaces on a device (thank you) like this:
lineinfile:
dest: “data.txt”
line: “{{ item }}: {{ ansible_facts[item].ipv4.address }}”
insertafter: EOF
delegate_to: 127.0.0.1
with_items: “{{ ansible_interfaces }}”
The problem is when docker is running, it creates interfaces like this:
veth[UNIQUE ID]
and they don’t have IP addresses. How do I ignore the interface beginning with veth?
I’ve tried this:
when: "{{ item }} == “^vether”
and
when: "{{ item }} = “vether.?”
but neither works. How would I do this?