-
Notifications
You must be signed in to change notification settings - Fork 43
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
Implement --check support for the libvirt.virt module #183
base: main
Are you sure you want to change the base?
Conversation
@lowjoel hello, thanks for your effort! please also add a changelog fragment of minor_changes type https://docs.ansible.com/ansible/latest/community/development_process.html#creating-a-changelog-fragment |
7f2c16c
to
07e9425
Compare
Thanks! |
hi @lowjoel thanks for this contribution! Wondering whether it's possible to add some tests to validate the functionality, like is done with |
Pretty much duplicated it and replaced it with |
@lowjoel hello, please take a look at
|
thanks! though in my case the harder part is to have a libvirt instance to test with because I (obviously) shouldn't be testing this in my production setup. |
SUMMARY
Implement --check support for the libvirt.virt module
Fixes #98.
ISSUE TYPE
COMPONENT NAME
virt
ADDITIONAL INFORMATION
Initial implementation to support --check mode.
This adds checking to the Virt class to make check mode calls no-ops but returning valid information where possible. For the get methods this doesn't affect behaviour, but for state changes and for defining domains this will make the Virt class do nothing in check mode.
For defining a new domain, this will pretty-print both XML definitions to make the diff output clean. It's not perfect because libvirt adds additional attributes when defining a domain that are implicit. Those will not change the domain if they are not specified in the input XML.