Re: [ansible-project] How to find network device by macaddress ?

2016-11-22 Thread Don Jackson
This worked great, thank you! For the record, here is the current version of my test playbook: - hosts: foo.example.com vars: target_macaddr: "0c:c4:7a:17:9a:94" tasks: - debug: var: hostvars[inventory_hostname]['ansible_' + item].device when: hostvars[inventory_host

Re: [ansible-project] How to find network device by macaddress ?

2016-11-22 Thread Kai Stian Olstad
On 22. nov. 2016 21:18, Don Jackson wrote: > Here is a truncated version of a fact for one network interface on a server: > > "ansible_eth2": { > "active": true, > "device": "eth2", > "macaddress": "30:0e:d5:cb:11:fe", > "type": "ether" > },

[ansible-project] How to find network device by macaddress ?

2016-11-22 Thread Don Jackson
Here is a truncated version of a fact for one network interface on a server: "ansible_eth2": { "active": true, "device": "eth2", "macaddress": "30:0e:d5:cb:11:fe", "type": "ether" }, And there are similar facts for each network int