diff --git a/lib/ansible/plugins/action/assemble.py b/lib/ansible/plugins/action/assemble.py index 51ceea5110..979d37f3d4 100644 --- a/lib/ansible/plugins/action/assemble.py +++ b/lib/ansible/plugins/action/assemble.py @@ -102,7 +102,7 @@ class ActionModule(ActionBase): result['msg'] = "src and dest are required" return result - remote_user = task_vars.get('ansible_ssh_user') or self._play_context.remote_user + remote_user = self._play_context.remote_user if boolean(remote_src): result.update(self._execute_module(tmp=tmp, task_vars=task_vars)) return result diff --git a/lib/ansible/plugins/action/copy.py b/lib/ansible/plugins/action/copy.py index 7f79952c90..8633693e81 100644 --- a/lib/ansible/plugins/action/copy.py +++ b/lib/ansible/plugins/action/copy.py @@ -139,7 +139,7 @@ class ActionModule(ActionBase): delete_remote_tmp = (len(source_files) == 1) # If this is a recursive action create a tmp path that we can share as the _exec_module create is too late. - remote_user = task_vars.get('ansible_ssh_user') or self._play_context.remote_user + remote_user = self._play_context.remote_user if not delete_remote_tmp: if tmp is None or "-tmp-" not in tmp: tmp = self._make_tmp_path(remote_user) diff --git a/lib/ansible/plugins/action/patch.py b/lib/ansible/plugins/action/patch.py index 88fe91ec2c..4c5319ab1e 100644 --- a/lib/ansible/plugins/action/patch.py +++ b/lib/ansible/plugins/action/patch.py @@ -36,7 +36,7 @@ class ActionModule(ActionBase): src = self._task.args.get('src', None) remote_src = boolean(self._task.args.get('remote_src', 'no')) - remote_user = task_vars.get('ansible_ssh_user') or self._play_context.remote_user + remote_user = self._play_context.remote_user if src is None: result['failed'] = True diff --git a/lib/ansible/plugins/action/script.py b/lib/ansible/plugins/action/script.py index 44cbff02e1..3b749b1e88 100644 --- a/lib/ansible/plugins/action/script.py +++ b/lib/ansible/plugins/action/script.py @@ -39,7 +39,7 @@ class ActionModule(ActionBase): result['msg'] = 'check mode not supported for this module' return result - remote_user = task_vars.get('ansible_ssh_user') or self._play_context.remote_user + remote_user = self._play_context.remote_user if not tmp: tmp = self._make_tmp_path(remote_user) self._cleanup_remote_tmp = True diff --git a/lib/ansible/plugins/action/template.py b/lib/ansible/plugins/action/template.py index 8b863dbae5..b1a3dc4281 100644 --- a/lib/ansible/plugins/action/template.py +++ b/lib/ansible/plugins/action/template.py @@ -145,7 +145,7 @@ class ActionModule(ActionBase): result['msg'] = type(e).__name__ + ": " + str(e) return result - remote_user = task_vars.get('ansible_ssh_user') or self._play_context.remote_user + remote_user = self._play_context.remote_user if not tmp: tmp = self._make_tmp_path(remote_user) self._cleanup_remote_tmp = True diff --git a/lib/ansible/plugins/action/unarchive.py b/lib/ansible/plugins/action/unarchive.py index 38a7faf1a5..8b6aaf94b1 100644 --- a/lib/ansible/plugins/action/unarchive.py +++ b/lib/ansible/plugins/action/unarchive.py @@ -59,7 +59,7 @@ class ActionModule(ActionBase): result['msg'] = "src (or content) and dest are required" return result - remote_user = task_vars.get('ansible_ssh_user') or self._play_context.remote_user + remote_user = self._play_context.remote_user if not tmp: tmp = self._make_tmp_path(remote_user) self._cleanup_remote_tmp = True