Ansible - recurse parameter

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

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.





Please enter 55446 in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |