find:paths: /tmprecurse: falsefile_type_ filepatterns: '^{{ item.filename }}\.[0-9]{6}.*$'use_regex: yesloop: {{ file }}
register: found
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/3419395b-36b0-4195-9278-de959fa763can%40googlegroups.com.
- name: look for backup files
find:
paths: /tmp
recurse: false
file_type: 'file'
patterns: '^{{ item.filename }}\.[0-9]{6}.*$'
use_regex: true
loop: ['backup']
register: found
- name: get list of files
set_fact:
files: "{{ found.results | json_query('[*].files[*][]') }}"
- name: show list of files
debug: var=item.path
loop: "{{ files }}"
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/7E9B8E33-5171-4B7B-80D0-8AAEEA6A7E44%40nist.gov.