Add find module patterns option use cases documentation (#57089)

* Specify that the pattern is matched against the dirent basename
* Specify that regexen must match the whole name of the dirent. It has been a pitfall for me.
This commit is contained in:
Marcello Barnaba 2019-06-03 17:00:15 +02:00 committed by Alicia Cozine
parent 2efb876b4c
commit 0e25f8aef2

View file

@ -37,6 +37,10 @@ options:
- One or more (shell or regex) patterns, which type is controlled by C(use_regex) option.
- The patterns restrict the list of files to be returned to those whose basenames match at
least one of the patterns specified. Multiple patterns can be specified using a list.
- The pattern is matched against the file base name, excluding the directory.
- When using regexen, the pattern MUST match the ENTIRE file name, not just parts of it. So
if you are looking to match all files ending in .default, you'd need to use '.*\.default'
as a regexp and not just '\.default'.
- This parameter expects a list, which can be either comma separated or YAML. If any of the
patterns contain a comma, make sure to put them in a list to avoid splitting the patterns
in undesirable ways.