-
Notifications
You must be signed in to change notification settings - Fork 45
Implement gathering of Interface and Mac from powered off domain #190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stratus-ss thanks for the contribution!
@csmart do i understand it correctly that we can't run integration tests in containers for this collection?
In my other PR, i uploaded a dockerfile that runs my integration tests. Does your question refer to running integration tests in your CI or whether its actually possible? |
I added integration tests as well as fedora and ubuntu Dockerfiles for reference as to how I stood up the containers. Tests run like this
Fedora:
|
@stratus-ss thanks, this looks good! I'm wondering whether the module should return NIC information for all VMs, if |
@Andersson007 we can in principle, but I don't know if we can in the Azure infra... I might have to dig into them some more. |
This has been updated to better handle multiple nics in the testing. We can simply extend the template and the test if we want to test for all interface types |
Thanks @stratus-ss ! |
@stratus-ss @csmart thanks for the contribution! |
# By Chris Smart (7) and others # Via Chris Smart * upstream/main: (21 commits) Update galaxy to next expected release Release 1.4.0 commit (ansible-collections#196) AZP: add 2.19, remove 2.16 (ansible-collections#195) Implement ansible module for management of libvirt volumes (ansible-collections#180) implement the removal of volumes when a domain is undefined (ansible-collections#191) Implement gathering of Interface and Mac from powered off domain (ansible-collections#190) Implement --check support for the libvirt.virt module (ansible-collections#183) updated doc fragment to add the uuid adding changelog fragment as per request Adding the ability to get the domuuid of a specified domain fix AZP matrix: remove stable-2.15 testing Update galaxy to next expected release Release 1.3.1 commit libvirt_lxc: Add configuration for libvirt_lxc_noseclabel (ansible-collections#182) AZP: update test matrix CI: add support for 2.19 (ansible-collections#179) README: remove old communication section (ansible-collections#178) README: Add Communication section with Forum information (ansible-collections#176) ci: update test container to 6.0.0 ...
* Refactor of virt_volume.py to fix many issues # By Chris Smart (7) and others # Via Chris Smart * upstream/main: (21 commits) Update galaxy to next expected release Release 1.4.0 commit (ansible-collections#196) AZP: add 2.19, remove 2.16 (ansible-collections#195) Implement ansible module for management of libvirt volumes (ansible-collections#180) implement the removal of volumes when a domain is undefined (ansible-collections#191) Implement gathering of Interface and Mac from powered off domain (ansible-collections#190) Implement --check support for the libvirt.virt module (ansible-collections#183) updated doc fragment to add the uuid adding changelog fragment as per request Adding the ability to get the domuuid of a specified domain fix AZP matrix: remove stable-2.15 testing Update galaxy to next expected release Release 1.3.1 commit libvirt_lxc: Add configuration for libvirt_lxc_noseclabel (ansible-collections#182) AZP: update test matrix CI: add support for 2.19 (ansible-collections#179) README: remove old communication section (ansible-collections#178) README: Add Communication section with Forum information (ansible-collections#176) ci: update test container to 6.0.0 ...
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: