ansible-role-libvirt-host icon indicating copy to clipboard operation
ansible-role-libvirt-host copied to clipboard

fix: add condition to execute socket services

Open btravouillon opened this issue 3 years ago • 2 comments

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"}

btravouillon avatar Sep 14 '22 20:09 btravouillon

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?

markgoddard avatar Sep 15 '22 08:09 markgoddard

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.

btravouillon avatar Sep 15 '22 12:09 btravouillon