From 5f4255615757e001737f6400fe7d59e5f4169344 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Tue, 25 Oct 2016 14:17:17 -0500 Subject: [PATCH] Updated for deprecated "ansible_ssh_user" Ansible has changed the variable ansible_ssh_user to ansible_user this change adds support for the option ansible_user while maintaining compatibility with the legacy option. Change-Id: I032a3562ccebbbf8f7248bfbec1e2c59b452587b Signed-off-by: Kevin Carter --- action/_v2_config_template.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/action/_v2_config_template.py b/action/_v2_config_template.py index 9cac8f9..a9bc2f5 100644 --- a/action/_v2_config_template.py +++ b/action/_v2_config_template.py @@ -465,7 +465,12 @@ class ActionModule(ActionBase): """Run the method""" try: - remote_user = task_vars.get('ansible_ssh_user') or self._play_context.remote_user + remote_user = task_vars.get('ansible_user') + if not remote_user: + remote_user = task_vars.get('ansible_ssh_user') + if not remote_user: + remote_user = self._play_context.remote_user + if not tmp: tmp = self._make_tmp_path(remote_user) except TypeError: