# Synchronize module does not allow set local user

**URL:** <https://forum.ansible.com/t/synchronize-module-does-not-allow-set-local-user/18433>\
**Category:** Ansible Project\
**Created:** [June 8, 2015, 4:57pm UTC](https://forum.ansible.com/t/synchronize-module-does-not-allow-set-local-user/18433 "2015-06-08T16:57:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nekmo\_com](https://avatars.discourse-cdn.com/v4/letter/n/90db22/32.png) [@Nekmo\_com](https://forum.ansible.com/u/Nekmo_com)\
**Post date:** [June 8, 2015, 4:57pm UTC](https://forum.ansible.com/t/synchronize-module-does-not-allow-set-local-user/18433/1 "2015-06-08T16:57:32Z")

</div>

I want to copy a directory from local (usign nekmo user) to a remote server (usign xxxxx\_ssh user). I have the following:

- hosts: vhome  
remote\_user: xxxxxx\_ssh  
tasks:
- name: Rsync  
synchronize: dest=/home/webs/DOCS/django src={{ project\_path }}/docs/\_build/html

This works remotely but not locally:

GATHERING FACTS \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
\<vhome.xxxxx.es\> ESTABLISH CONNECTION FOR USER: xxxxx\_ssh  
\<vhome.xxxxx.es\> REMOTE\_MODULE setup

ok: [vhome.xxxxx.es]

TASK: [Rsync] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
\<127.0.0.1\> ESTABLISH CONNECTION FOR USER: xxxxx\_ssh  
[…]  
Permission denied (publickey,password).

The local user must be “nekmo”. If I do not put “remote\_user” param this does not work remotely (this use “nekmo” as remote user).

I need to set the local user, or afford to ignore the parameter “remote\_user” for localhost.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 8, 2015, 10:47pm UTC](https://forum.ansible.com/t/synchronize-module-does-not-allow-set-local-user/18433/2 "2015-06-08T22:47:35Z")

</div>

remote\_user is ignored on local connections, ansible will always run  
with the user that ran ansible (unless you use sudo).
