Created
March 1, 2021 22:48
-
-
Save andrewgdunn/bd8dc605932a6fb5ecc8caef4efcd25b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: get the device name of the nic of a given mac | |
command: bash -c "ip a | grep {{macaddress}} -B 1 | awk '{print $2; ; exit}' | sed s/://g" | |
register: network_device_name | |
- name: get the pciid of the network device using facts | |
debug: | |
msg: "{{ansible_facts[network_device_name.stdout].pciid}}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment