Search via regex instead of shell glob
This commit is contained in:
		| @@ -135,9 +135,9 @@ | ||||
|     follow: 'no' | ||||
|     paths: | ||||
|       - '/var/lib/clamav/' | ||||
|     patterns: | ||||
|       - '^tmp.([0-9]|[a-f}){10}$' | ||||
|     recurse: 'yes' | ||||
|     use_regex: 'yes' | ||||
|   register: 'results' | ||||
| - name: 'And drop them' | ||||
|   when: | ||||
| @@ -145,7 +145,9 @@ | ||||
|     - ensure_clamav is defined | ||||
|     - freshclam_retention is defined | ||||
|     - freshclam_retention is regex('^[0-9]*[smhdw]$') | ||||
|     - item.path is regex('^/var/lib/clamav/tmp\.([0-9]|[a-f])*$') | ||||
|     - results is defined | ||||
|     - results.files is defined | ||||
|     - results.files is iterable | ||||
|   ansible.builtin.file: | ||||
|     path: '{{ item.path }}' | ||||
|     state: 'absent' | ||||
|   | ||||
		Reference in New Issue
	
	Block a user