Ansible - recurse parameter
by
Jeremy Canfield |
Updated: January 04 2021
| Ansible articles
The recurse parameters is used to recursively search at and below a certain directory. For example, let's say you are using the find module to determine if there is a file named "foo.txt" at or below the /tmp directory. Setting the recurse parameter to true will search the /tmp directory, and any subdirectories within the /tmp directory, like this.
- name: determine if there is a file named 'foo.txt' at or below the /tmp directory
find:
paths: /tmp
file_type: file
hidden: true
patterns: foo.txt
recurse: true
register: out
Did you find this article helpful?
If so, consider buying me a coffee over at