-
Notifications
You must be signed in to change notification settings - Fork 41
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
ansible-playbook --check mode/diff support for virt module #98
Comments
Hi @nodiscc, thanks for the suggestion! I'll need to think about this some more and have some conversations with others more knowledgeable than I am. I think that What sort of things would you expect to see in the diff? For example, if you had a task to power a VM off which was currently on, or to add another device to an existing VM, etc? Cheers, |
Hi @csmart , sorry for the late reply A very basic use case for - name: start libvirt VMs
community.libvirt.virt:
name: "{{ item.name }}"
state: "{{ item.state }}"
with_items:
- name: vm1.example.org
state: running
- name: vm2.example.org
state: running
- name: vm3.example.org
state: running When executed in check mode, the task returns
But I would expect it to return the same output as without
(vm1 was already on, vm2 and vm3 were just started) Thanks |
SUMMARY
The
virt
module does not seem to support ansible-playbook--check
mode - in check mode, tasks that use the virt module will always returnskipped
.ISSUE TYPE
COMPONENT NAME
virt
ADDITIONAL INFORMATION
This would allow reviewing changes in "dry-run" mode before actually applying them. Running the
virt
module in check mode should return the expectedok/changed
state, and a diff of the VM XML definition when relevant (for example whencommand: define
).ansible-playbook playbook.yml --tags libvirt --check --diff
The text was updated successfully, but these errors were encountered: