You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using community.libvirt.virt to define a new VM from a template with no MAC addresses statically assigned. On first run, everything seems to work fine. The VM gets created. The network interfaces seem good. However on the second run of the playbook, that task says it will update the ethernet address for the VM but looking at the XML from virsh, it didnt change. This renders the task not idempotent. The template didnt change between the two runs.
# $HOME/collections/ansible_collections
Collection Version
----------------- -------
community.libvirt 1.3.1
# /usr/local/lib/python3.11/site-packages/ansible_collections
Collection Version
----------------- -------
community.libvirt 1.3.0
CONFIGURATION
Here is the generated XML devices stanza for interfaces:
<!-- Set Network options - New version -->
<interface type='bridge'>
<source bridge='br1'/>
<model type='virtio'/>
</interface>
<interface type='bridge'>
<source bridge='br2'/>
<model type='virtio'/>
</interface>
OS / ENVIRONMENT
RHEL9.5 running libvirt 10.5.0-7
STEPS TO REPRODUCE
using the XML above I was able to use it with the task:
- name: config_vms | ensure the VM is defined
community.libvirt.virt:
command: define
xml: "{{ lookup('template', vm.xml_file | default('vm-template.xml.RHEL9.j2')) }}"
uri: "{{ libvirt_vm_uri | default(omit, true) }}"
SUMMARY
Using community.libvirt.virt to define a new VM from a template with no MAC addresses statically assigned. On first run, everything seems to work fine. The VM gets created. The network interfaces seem good. However on the second run of the playbook, that task says it will update the ethernet address for the VM but looking at the XML from virsh, it didnt change. This renders the task not idempotent. The template didnt change between the two runs.
ISSUE TYPE
COMPONENT NAME
community.libvirt.virt
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
RHEL9.5 running libvirt 10.5.0-7
STEPS TO REPRODUCE
using the XML above I was able to use it with the task:
EXPECTED RESULTS
I expected the second run of the playbook to yield idempotency.
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: