ansible-role-libvirt-host
ansible-role-libvirt-host copied to clipboard
fix: add condition to execute socket services
When listen_address is not defined (default), the drop-in files are not created. Make sure the role will not try to manage the non-existing services.
Without this change, the role fails with the error below when none of libvirt_host_tcp_listen_address or libvirt_host_tls_listen_address are defined:
RUNNING HANDLER [stackhpc.libvirt-host : start libvirtd sockets] *****************************************
failed: [labnode] (item=libvirtd-tcp.socket) => {"ansible_loop_var": "item", "changed": false, "item": {"enabled": false, "listen_address": null, "service": "libvirtd-tcp.socket"}, "msg": "Could not find the requested service libvirtd-tcp.socket: host"}
failed: [labnode] (item=libvirtd-tls.socket) => {"ansible_loop_var": "item", "changed": false, "item": {"enabled": false, "listen_address": null, "service": "libvirtd-tls.socket"}, "msg": "Could not find the requested service libvirtd-tls.socket: host"}
Hi @btravouillon, thanks for the patch. I think the code is working as expected - it should be possible to start the units without a listen address.
Perhaps for some reason on your system you don't have the libvirt socket systemd units? I think that would give the error above, which would be avoided by creating drop-in units, and therefore defining the socket services.
What OS are you using?
What OS are you using?
This is Ubuntu 18.04. Indeed the socket systemd units do not exist. I should check 20.04 or 22.04.