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.