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