Skip to content

Commit 6621690

Browse files
committed
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.
1 parent 9edce18 commit 6621690

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

handlers/main.yml

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
state: "{{ item.enabled | bool | ternary('started', 'stopped') }}"
2121
become: true
2222
loop: "{{ _libvirt_socket_services }}"
23+
when:
24+
- item.listen_address is not none
25+
- item.listen_address | length > 0
2326
loop_control:
2427
label: "{{ item.service }}"
2528
listen:

tasks/config.yml

+4
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@
141141
enabled: "{{ item.enabled | bool }}"
142142
become: True
143143
loop: "{{ _libvirt_services }}"
144+
when:
145+
- item.listen_address is defined
146+
- item.listen_address is not none
147+
- item.listen_address | length > 0
144148
loop_control:
145149
label: "{{ item.service }}"
146150
vars:

0 commit comments

Comments
 (0)