diff --git a/lib/ansible/plugins/action/__init__.py b/lib/ansible/plugins/action/__init__.py index 6cea019ce18..6f63231b14b 100644 --- a/lib/ansible/plugins/action/__init__.py +++ b/lib/ansible/plugins/action/__init__.py @@ -166,7 +166,7 @@ class ActionBase: tmp_mode = None if self._play_context.remote_user != 'root' or self._play_context.become and self._play_context.become_user != 'root': - tmp_mode = 0755 + tmp_mode = 0o755 cmd = self._connection._shell.mkdtemp(basefile, use_system_tmp, tmp_mode) self._display.debug("executing _low_level_execute_command to create the tmp path") diff --git a/lib/ansible/plugins/shell/sh.py b/lib/ansible/plugins/shell/sh.py index 1464fd09fab..249131a0fb5 100644 --- a/lib/ansible/plugins/shell/sh.py +++ b/lib/ansible/plugins/shell/sh.py @@ -70,7 +70,7 @@ class ShellModule(object): # change the umask in a subshell to achieve the desired mode # also for directories created with `mkdir -p` if mode: - tmp_umask = 0777 & ~mode + tmp_umask = 0o777 & ~mode cmd = '(umask %o && %s)' % (tmp_umask, cmd) return cmd