Skip to content

Commit

Permalink
fix: add condition to execute socket services
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
btravouillon committed Sep 14, 2022
1 parent 9edce18 commit 6621690
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6621690

Please sign in to comment.