File tree Expand file tree Collapse file tree 3 files changed +27
-21
lines changed Expand file tree Collapse file tree 3 files changed +27
-21
lines changed Original file line number Diff line number Diff line change 4
4
# complexity = low
5
5
# disruption = low
6
6
7
- {{%- for path in FILEPATH %}}
8
- {{%- if IS_DIRECTORY %}}
9
- {{%- if FILE_REGEX %}}
10
-
11
7
{{%- if RECURSIVE %}}
12
- {{%- set FIND_RECURSE_ARGS="" %}}
8
+ {{%- set FIND_RECURSE_ARGS_DEP="" %}}
9
+ {{%- set FIND_RECURSE_ARGS_SYM="" %}}
13
10
{{%- else %}}
14
- {{%- set FIND_RECURSE_ARGS="-maxdepth 1" %}}
11
+ {{%- set FIND_RECURSE_ARGS_DEP="-maxdepth 1" %}}
12
+ {{%- set FIND_RECURSE_ARGS_SYM="-L" %}}
15
13
{{%- endif %}}
16
14
15
+ {{%- for path in FILEPATH %}}
16
+ {{%- if IS_DIRECTORY %}}
17
+ {{%- if FILE_REGEX %}}
18
+
17
19
- name: Find {{{ path }}} file(s) matching {{{ FILE_REGEX[loop.index0] }}}{{% if RECURSIVE %}} recursively{{% endif %}}
18
- command: 'find -H {{{ path }}} {{{ FIND_RECURSE_ARGS }}} -type f ! -group {{{ GID_OR_NAME }}} -regextype posix-extended -regex "{{{ FILE_REGEX[loop.index0] }}}"'
20
+ command: 'find {{{ FIND_RECURSE_ARGS_SYM }}} {{{ path }}} {{{ FIND_RECURSE_ARGS_DEP }}} -type f ! -group {{{ GID_OR_NAME }}} -regextype posix-extended -regex "{{{ FILE_REGEX[loop.index0] }}}"'
19
21
register: files_found
20
22
changed_when: False
21
23
failed_when: False
Original file line number Diff line number Diff line change 4
4
# complexity = low
5
5
# disruption = low
6
6
7
- {{%- for path in FILEPATH %}}
8
- {{%- if IS_DIRECTORY %}}
9
- {{%- if FILE_REGEX %}}
10
-
11
7
{{%- if RECURSIVE %}}
12
- {{%- set FIND_RECURSE_ARGS="" %}}
8
+ {{%- set FIND_RECURSE_ARGS_DEP="" %}}
9
+ {{%- set FIND_RECURSE_ARGS_SYM="" %}}
13
10
{{%- else %}}
14
- {{%- set FIND_RECURSE_ARGS="-maxdepth 1" %}}
11
+ {{%- set FIND_RECURSE_ARGS_DEP="-maxdepth 1" %}}
12
+ {{%- set FIND_RECURSE_ARGS_SYM="-L" %}}
15
13
{{%- endif %}}
16
14
15
+ {{%- for path in FILEPATH %}}
16
+ {{%- if IS_DIRECTORY %}}
17
+ {{%- if FILE_REGEX %}}
18
+
17
19
- name: Find {{{ path }}} file(s) matching {{{ FILE_REGEX[loop.index0] }}}{{% if RECURSIVE %}} recursively{{% endif %}}
18
- command: 'find -H {{{ path }}} {{{ FIND_RECURSE_ARGS }}} -type f ! -user {{{ UID_OR_NAME }}} -regextype posix-extended -regex "{{{ FILE_REGEX[loop.index0] }}}"'
20
+ command: 'find {{{ FIND_RECURSE_ARGS_SYM }}} {{{ path }}} {{{ FIND_RECURSE_ARGS_DEP }}} -type f ! -user {{{ UID_OR_NAME }}} -regextype posix-extended -regex "{{{ FILE_REGEX[loop.index0] }}}"'
19
21
register: files_found
20
22
changed_when: False
21
23
failed_when: False
Original file line number Diff line number Diff line change 4
4
# complexity = low
5
5
# disruption = low
6
6
7
+ {{%- if RECURSIVE %}}
8
+ {{%- set FIND_RECURSE_ARGS_DEP="" %}}
9
+ {{%- set FIND_RECURSE_ARGS_SYM="" %}}
10
+ {{%- else %}}
11
+ {{%- set FIND_RECURSE_ARGS_DEP="-maxdepth 1" %}}
12
+ {{%- set FIND_RECURSE_ARGS_SYM="-L" %}}
13
+ {{%- endif %}}
14
+
7
15
{{% for path in FILEPATH %}}
8
16
{{% if IS_DIRECTORY %}}
9
17
17
25
{{% set FIND_FILE_REGEX="" %}}
18
26
{{%- endif %}}
19
27
20
- {{%- if RECURSIVE %}}
21
- {{% set FIND_RECURSE_ARGS="" %}}
22
- {{%- else %}}
23
- {{% set FIND_RECURSE_ARGS="-maxdepth 1" %}}
24
- {{%- endif %}}
25
-
26
28
{{%- if ALLOW_STRICTER_PERMISSIONS %}}
27
29
{{% set PERMS="-perm /" + SEARCH_MODE %}}
28
30
{{%- else %}}
36
38
{{%- endif %}}
37
39
38
40
- name: Find {{{ path }}} file(s){{% if RECURSIVE %}} recursively{{% endif %}}
39
- command: 'find -H {{{ path }}} {{{ FIND_RECURSE_ARGS }}} {{{ PERMS }}} {{{ EXCLUDED_FILES_ARGS }}} {{{ FIND_TYPE }}} {{{ FIND_FILE_REGEX }}}'
41
+ command: 'find {{{ FIND_RECURSE_ARGS_SYM }}} {{{ path }}} {{{ FIND_RECURSE_ARGS_DEP }}} {{{ PERMS }}} {{{ EXCLUDED_FILES_ARGS }}} {{{ FIND_TYPE }}} {{{ FIND_FILE_REGEX }}}'
40
42
register: files_found
41
43
changed_when: False
42
44
failed_when: False
You can’t perform that action at this time.
0 commit comments