Synchronize via sudo -- no tty present and no askpass program specified

1,906 views
Skip to first unread message

johhue

unread,
Oct 4, 2015, 9:01:04 AM10/4/15
to Ansible Project
Hello, I have seen many similar topics but want to make sure my issue is the same.

Our enterprise is taking a look at Ansible to handle non-root tasks. I am trying to use the synchronize module but having many issues getting it to work with sudo.

Assume no root access, and the maintenance user we can connect with has SUDO to other users.

Task:

- name:
  when: app_user|default(None) != None
  become: yes
  become_user: "{{ app_user }}"
  become_method: sudo
  synchronize: src=x dest=/app//{{ app_user }}/testx


Fails with this error:

msg: sudo: no tty present and no askpass program specified
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]

Any ideas?

I have tried messing with the rsync_path --

I dont want to mess around too much as I am afraid my sudo password I type in will end in plain text somewhere.

Mirko Friedenhagen

unread,
Oct 4, 2015, 12:22:12 PM10/4/15
to ansible-project

Hello Johue,

I ended up turning sudo to NOPASS during the action and resetting it afterwards.

Regards
Mirko
--
Sent from my mobile

--
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/2e9d2c84-cb85-42ba-8cd2-48d4820f5e29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

johhue

unread,
Oct 5, 2015, 11:59:55 AM10/5/15
to Ansible Project
This will not work for us. We have to give the password as part of our security rules.

Guo Nosun

unread,
Jun 21, 2017, 12:29:56 PM6/21/17
to Ansible Project


在 2015年10月5日星期一 UTC+8下午11:59:55,johhue写道:

Guo Nosun

unread,
Jun 21, 2017, 12:30:03 PM6/21/17
to Ansible Project
Any Ideas, I met the same issue
Reply all
Reply to author
Forward
0 new messages