diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index c02f25a62a5..8b61da3f457 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -898,7 +898,7 @@ class AnsibleModule(object): def _symbolic_mode_to_octal(self, path_stat, symbolic_mode): new_mode = stat.S_IMODE(path_stat.st_mode) - mode_re = re.compile(r'^(?P[ugoa]+)(?P[-+=])(?P[rwxXst]*|[ugo])$') + mode_re = re.compile(r'^(?P[ugoa]+)(?P[-+=])(?P[rwxXst-]*|[ugo])$') for mode in symbolic_mode.split(','): match = mode_re.match(mode) if match: