Synchronize module does not allow set local user

81 views
Skip to first unread message

Nekmo com

unread,
Jun 8, 2015, 6:46:33 PM6/8/15
to ansible...@googlegroups.com
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.

Brian Coca

unread,
Jun 8, 2015, 6:47:39 PM6/8/15
to ansible...@googlegroups.com
remote_user is ignored on local connections, ansible will always run
with the user that ran ansible (unless you use sudo).
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/b46838dd-d283-4707-b80f-de98bf66e799%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Brian Coca
Reply all
Reply to author
Forward
0 new messages