Skip to content

Commit cb8c450

Browse files
authored
fixed wrong count in fragmentspath (#93)
* reads length of fragmentspath to delete files if not needed
1 parent 83fb42c commit cb8c450

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

roles/icinga2/tasks/configure.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,6 @@
101101
ansible.builtin.file:
102102
state: absent
103103
path: "{{ item |regex_replace('^'+icinga2_fragments_path, '/etc/icinga2') }}"
104-
when: item.split('/')[3] == 'conf.d' or item.split('/')[3] == 'zones.d'
104+
when: item.split('/')[icinga2_fragments_path.split('/')|length] == 'conf.d' or item.split('/')[icinga2_fragments_path.split('/')|length] == 'zones.d'
105105
loop: "{{ _empty_result.stdout_lines }}"
106106
notify: reload icinga2 service

0 commit comments

Comments
 (0)