Implement gathering of Interface and Mac from powered off domain #190
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
There are use cases where you need to get the mac address of a domain in order to provide it to PXE, Sushy-tools or other related tools. There should be a way to get this information without powering on the machine
Fixes #189
ISSUE TYPE
COMPONENT NAME
This is an addition to the plugin virt.py which allows the ansible module to process the xml generated by
get_xml
in order to return the interfaces and their associate mac addressesThis makes use of
etree.fromstring
to get the xml. A dictionary is returned with the primary key beingnetwork_interfaces
with a nested dict containing the interface name as the key for an additional dict containing the mac address and the pci bus:ADDITIONAL INFORMATION
A simple playbook
And the output: