Skip to content

Commit

Permalink
Aling find regextype in file templates
Browse files Browse the repository at this point in the history
Align the templates file_groupowner and file_permissions with the
changes in file_owner.
  • Loading branch information
marcusburghardt committed May 30, 2024
1 parent fe7a5ea commit 8797ca8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion shared/templates/file_groupowner/ansible.template
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{{%- endif %}}

- name: Find {{{ path }}} file(s) matching {{{ FILE_REGEX[loop.index0] }}}{{% if RECURSIVE %}} recursively{{% endif %}}
command: 'find -H {{{ path }}} {{{ FIND_RECURSE_ARGS }}} -type f ! -group {{{ GID_OR_NAME }}} -regex "{{{ FILE_REGEX[loop.index0] }}}"'
command: 'find -H {{{ path }}} {{{ FIND_RECURSE_ARGS }}} -type f ! -group {{{ GID_OR_NAME }}} -regextype posix-extended -regex "{{{ FILE_REGEX[loop.index0] }}}"'
register: files_found
changed_when: False
failed_when: False
Expand Down
2 changes: 1 addition & 1 deletion shared/templates/file_groupowner/bash.template
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{{%- if IS_DIRECTORY %}}
{{%- if FILE_REGEX %}}

find {{{ path }}} {{{ FIND_RECURSE_ARGS }}} -type f ! -group {{{ GID_OR_NAME }}} -regex '{{{ FILE_REGEX[loop.index0] }}}' -exec chgrp {{{ GID_OR_NAME }}} {} \;
find {{{ path }}} {{{ FIND_RECURSE_ARGS }}} -type f ! -group {{{ GID_OR_NAME }}} -regextype posix-extended -regex '{{{ FILE_REGEX[loop.index0] }}}' -exec chgrp {{{ GID_OR_NAME }}} {} \;
{{%- else %}}
find -H {{{ path }}} {{{ FIND_RECURSE_ARGS }}} -type d -exec chgrp {{{ GID_OR_NAME }}} {} \;
{{%- endif %}}
Expand Down
2 changes: 1 addition & 1 deletion shared/templates/file_permissions/ansible.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{%- if FILE_REGEX %}}
{{% set STATE="file" %}}
{{% set FIND_TYPE="-type f" %}}
{{% set FIND_FILE_REGEX="-regex \"" ~ FILE_REGEX[loop.index0] ~ "\"" %}}
{{% set FIND_FILE_REGEX="-regextype posix-extended -regex \"" ~ FILE_REGEX[loop.index0] ~ "\"" %}}
{{%- else %}}
{{% set STATE="directory" %}}
{{% set FIND_TYPE="-type d" %}}
Expand Down
2 changes: 1 addition & 1 deletion shared/templates/file_permissions/bash.template
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{{% for path in FILEPATH %}}
{{%- if IS_DIRECTORY %}}
{{%- if FILE_REGEX %}}
find -H {{{ path }}} {{{ FIND_RECURSE_ARGS }}} {{{ PERMS }}} {{{ EXCLUDED_FILES_ARGS }}} -type f -regex '{{{ FILE_REGEX[loop.index0] }}}' -exec chmod {{{ FILEMODE }}} {} \;
find -H {{{ path }}} {{{ FIND_RECURSE_ARGS }}} {{{ PERMS }}} {{{ EXCLUDED_FILES_ARGS }}} -type f -regextype posix-extended -regex '{{{ FILE_REGEX[loop.index0] }}}' -exec chmod {{{ FILEMODE }}} {} \;
{{%- else %}}
find -H {{{ path }}} {{{ FIND_RECURSE_ARGS }}} {{{ PERMS }}} -type d -exec chmod {{{ FILEMODE }}} {} \;
{{%- endif %}}
Expand Down

0 comments on commit 8797ca8

Please sign in to comment.