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 <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2016-10-25 14:17:17 -05:00 committed by Michael Carden
parent d364f1bb27
commit 5f42556157
1 changed files with 6 additions and 1 deletions

View File

@ -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: