From 9aa421441718d097361d26e4c80ff56fd7da832a Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 30 Jul 2015 20:53:18 -0400 Subject: [PATCH] fixed delegate_to ref in syncronize --- lib/ansible/plugins/action/synchronize.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/ansible/plugins/action/synchronize.py b/lib/ansible/plugins/action/synchronize.py index b9451c13f48..031a2b0e977 100644 --- a/lib/ansible/plugins/action/synchronize.py +++ b/lib/ansible/plugins/action/synchronize.py @@ -140,14 +140,12 @@ class ActionModule(ActionBase): user = None if boolean(task_vars.get('set_remote_user', 'yes')): - if use_delegate: - user = task_vars['hostvars'][conn.delegate].get('ansible_ssh_user') - if not use_delegate or not user: user = task_vars.get('ansible_ssh_user') or self._play_context.remote_user + elif use_delegate: + user = task_vars['hostvars'][task_vars.get('delegate_to')].get('ansible_ssh_user') if use_delegate: - # FIXME private_key = task_vars.get('ansible_ssh_private_key_file') or self._play_context.private_key_file else: private_key = task_vars.get('ansible_ssh_private_key_file') or self._play_context.private_key_file