find

Collection: builtin

Full Name: parallax.builtin.find

Aliases: ansible.builtin.find, find

Synopsis

Manage find

Parameters

NameTypeRequiredDefaultDescription
pathslistyesList of paths of directories to search
patternslistOne or more shell or regex patterns
excludeslistOne or more shell or regex patterns to exclude
containsstringA regular expression or pattern which should be matched against the file content
recurseboolfalseIf target is a directory, recursively descend into the directory looking for files
file_typestringfileType of file to select Choices: any, directory, file, link
followboolfalseSet this to true to follow symlinks in path for systems with python 2.6+
hiddenboolfalseSet this to true to include hidden files
sizestringSelect files whose size is equal to or greater than the specified size
agestringSelect files whose age is equal to or greater than the specified time
age_stampstringmtimeChoose the file property against which age is compared Choices: atime, ctime, mtime
use_regexboolfalseIf false, the patterns are shell style globs
get_checksumboolfalseSet this to true to retrieve a file’s sha1 checksum
checksum_algorithmstringsha1Algorithm to determine checksum of file Choices: md5, sha1, sha224, sha256, sha384, sha512
depthintSet the maximum number of levels to descend into
read_whole_fileboolfalseWhen doing a contains search, determines whether the whole file is read into memory

Example

- name: Example find task
  find:
    paths: <your_paths>