Sample Header Ad - 728x90

ansible rsync command fails from using non-kerberos ssh on remost system

1 vote
0 answers
92 views
I wish to rsync a directory structure from one remote server to another - using an Ansible playbook.yml. During the play, the ansible shell module's command for rsync fails. I know the reason - it's using a default vendor ssh executable as the backbone of the rsync command. It needs to use a kerberos version of ssh - which is also on the remote system. If I manually log onto remoteA, and execute the exact same rsync command given in the absible script (with the -e /path/to/Kerberos/ssh), it works fine. But it looks like Ansible does not actually honor the -e flag for declaring what ssh to use and therefore generates a Kerberos authentication error. Is there some way to get it use the correct ssh version with the rsync executable? This is exactly what the -e /desired/version/of/ssh was declaring - but, again, ansible seems to not be able to use that for some reason.
- name:  "rsync base_directory remoteA  ==> remoteB"
    shell:
      cmd: 'rsync -av -e /path/to/kerberos/version/ssh  base_directory username@remoteB.xxx.xxx.com:/path/to/desired/location/'
      chdir: '/path/to/remtoteA/parentDir/for/base_directory'
UPDATE: (no solution yet) let me ask the same question in a different way: How can I force Ansible to use a particular path to ssh as opposed to the first one it finds from the system environment ORIGINAL path? - I have tried the user .bashrc $PATH to find help find the correct ssh executable, but it has no effect on the ansible play - only for me when I log in. - I am logging in via a regular SSH session, as the same user of the ansible playbook. Again, in regular ssh sessions, the rsync command works; the syntax of the command is exactly the same in the playbook where it fails. - extra info: There are 8 servers in our company. I am switching this play to run on a different server from the previous, (where all things work fine, as that server has the kerberized ssh in the default path) only because that server will be decommissioned. Still confused why the newer server is not configured the same, but it's not. And there seems to be nothing I have found to get the rsync command to find (and use) the kerberized version of ssh over the vendor non-keberized version.
Asked by RichWalt (111 rep)
Oct 13, 2024, 06:44 PM
Last activity: Oct 15, 2024, 05:56 PM