diff --git a/lib/ansible/plugins/shell/__init__.py b/lib/ansible/plugins/shell/__init__.py index d0613beeb33..ef1c5bb9291 100644 --- a/lib/ansible/plugins/shell/__init__.py +++ b/lib/ansible/plugins/shell/__init__.py @@ -90,10 +90,11 @@ class ShellBase(object): mode = pipes.quote(mode) user = pipes.quote(user) - cmd = ['setfacl'] + cmd = ['setfacl', '-m', 'u:%s:%s' % (user, mode)] if recursive: - cmd.append('-R') - cmd.extend(('-m', 'u:%s:%s %s' % (user, mode, path))) + cmd = ['find', path, '-exec'] + cmd + ["'{}'", "';'"] + else: + cmd.append(path) return ' '.join(cmd)