:::: MENU ::::

find the name of ethernet interface in ansible

you have to use the fact: ansible_default_ipv4.interface

tasks:
– name: “set the fact for the name of default eth”
set_fact: eth_name={{ansible_default_ipv4.interface}}
– debug: var=eth_name


So, what do you think ?