Doing su -c 'ssh {{ ssh_peer }}'

Hi all,

This stopped working after some upgrade of ansible:

- - -
  - name: Test new ssh connection
    command: "su {{ sk_user }} -c 'ssh {{ ssh_peer }} date‘“
- - -

It just hungs in the shell.

How can this be done in 2.13.1?

Any help appreciated,
Axel

OS is FreeBSD.

A.

If I install sudo, this seems to work:


shell: sudo -u {{ sk_user }} ssh {{ ssh_peer }} date


Axel

If I install sudo, this seems to work:
- - -
shell: sudo -u {{ sk_user }} ssh {{ ssh_peer }} date
- - -

Ansible can do the privilege escalation to an arbitrary user as well:

command: ssh {{ ssh_peer }} date

become_user: "{{ sympa_unix_user }}"
vars:
ansible_ssh_pipelining: true

Regards

       Racke

Looks good. Will try it!

Thanks,
Axel