diff --git a/handlers/main.yml b/handlers/main.yml index 183bcc9..9d787ed 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -20,6 +20,9 @@ state: "{{ item.enabled | bool | ternary('started', 'stopped') }}" become: true loop: "{{ _libvirt_socket_services }}" + when: + - item.listen_address is not none + - item.listen_address | length > 0 loop_control: label: "{{ item.service }}" listen: diff --git a/tasks/config.yml b/tasks/config.yml index 7817377..4296065 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -141,6 +141,10 @@ enabled: "{{ item.enabled | bool }}" become: True loop: "{{ _libvirt_services }}" + when: + - item.listen_address is defined + - item.listen_address is not none + - item.listen_address | length > 0 loop_control: label: "{{ item.service }}" vars: