Dear all, I am implementing a task which should configure a network interface according to the macaddress.
For example: "ansible_eth1": { "active": true, "device": "eth1", "id": "8000.0050568d1cf8", "interfaces": [ "peth1" ], "ipv4": { "address": "129.94.72.12", "broadcast": "129.94.72.63", "netmask": "255.255.255.192", "network": "129.94.72.0" }, "ipv6": [ { "address": "fe80::250:56ff:fe8d:1cf8", "prefix": "64", "scope": "link" } ], "macaddress": "00:50:56:8d:1c:f8", "mtu": 1500, "promisc": false, "stp": false, "type": "bridge" }, The tricky part is, the device name (such as eth1) is not reliable, the OS may assign differently after reinstallation. So I can only rely on macaddress, then pass the device name to my shell script for configuration. I attempted to work around with "when" and "with_items" but got syntax error all the time. Can someone show the correct way to do this? Cheers, Derrick -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5aee27db-0fce-4468-9d7c-8ee90413075d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.