-
Notifications
You must be signed in to change notification settings - Fork 42
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
Update of libvirt network default fails #47
Comments
I analysed the code. The root cause is in the following snipped. community.libvirt/plugins/modules/virt_net.py Lines 552 to 564 in 0e7873a
A playbook define command is only executed, if the network does not exist. It cannot overwrite an existing network definition. This is different to the define command in virt for domains. The same logic is implemented for community.libvirt/plugins/modules/virt_net.py Lines 522 to 529 in 0e7873a
Since the documentation is very sparse, I am not sure whether this is defined behaviour or not. I would propose a patch, when I clarified the target behaviour. At the moment, I am not sure with whom to clarify it. |
Looking at the definitions in the libvirt API:
There is no 'modify' in libvirt - so that is legacy in this module from my point of view and I'd rather see that become an alias for 'define' than carry extra unnecessary logic. I haven't done a good look through the effects of this suggestion, so please do that if you can. |
I'm experiencing the same problem. Interestingly enough, redefining |
Same problem for me, but not for default network only - just for any network. Still no updates/plans since 2020?
|
SUMMARY
I want to update the default network of libvirt (purpose: add IPv6). Ansible reports that no change is necessary:
ok: [localhost]
, although the XML definition is different from what I get fromsudo virsh net-dumpxml default
.If I change the name in the ansible code but not in the XML definition, the default network gets updated as wanted.
ISSUE TYPE
COMPONENT NAME
community.libvirt.virt_net
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Fedora 32 (Workstation Edition)
STEPS TO REPRODUCE
(1) Create a new file network_default.xml with the current XML definition of the default network.
Modify the file.
(2) Run an ansible playbook containing the tasks:
Ansible reports that no change is necessary:
ok: [localhost]
, although the XML definition is different from what I get fromsudo virsh net-dumpxml default
.(3) Change the name of the network in the playbook but not in the network_default.xml.
The default network gets updated as wanted.
sudo virsh net-dumpxml default
shows the change.EXPECTED RESULTS
The text was updated successfully, but these errors were encountered: