Problem with file transfer

21 views
Skip to first unread message

Axel Kurowski

unread,
Mar 21, 2023, 6:25:39 AM3/21/23
to Ansible Project
Hello,

I have two hosts and I would like to transfer a file between them.
So I have the file.tar.gz and I need to copy it from HOST1 to HOST2.

When we execute the playbook, it hangs on the step:

Using module file /usr/lib/python2.7/site-packages/ansible/modules/files/synchronize.py
<129.103.138.122> PUT /var/lib/awx/.ansible/tmp/ansible-local-771BsaW/tmpAa0jFW TO /home/testacc2/.ansible/tmp/ansible-tmp-1679047385.72-56-125137671798457/AnsiballZ_synchronize.py
<129.103.138.122> SSH: EXEC scp -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="testacc2"' -o ConnectTimeout=60 -C -o ControlMaster=auto -o ControlPersist=30m -o ServerAliveInterval=120 -o ServerAliveCountMax=20 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null '-oProxyCommand=ssh -i $JH3_SSH_PRIVATE_KEY -W %h:%p -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oProxyCommand="ssh -i $JH2_SSH_PRIVATE_KEY -W 198.18.182.66:22 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oProxyCommand=\\"ssh -i $JH1_SSH_PRIVATE_KEY -W 146.22.163.188:22 -m hmac-sha1 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null autot...@100.79.241.7\\" auto...@146.22.163.188" conn...@198.18.182.66' -o ControlPath=/tmp/bwrap_20466389__xp6awau/awx_20466389_8ozc1hbg/cp/90ab54c264 /var/lib/awx/.ansible/tmp/ansible-local-771BsaW/tmpAa0jFW '[129.103.138.122]:/home/testacc2/.ansible/tmp/ansible-tmp-1679047385.72-56-125137671798457/AnsiballZ_synchronize.py'
<129.103.138.122> (0, '', '')
<129.103.138.122> ESTABLISH SSH CONNECTION FOR USER: testacc2
<129.103.138.122> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="testacc2"' -o ConnectTimeout=60 -C -o ControlMaster=auto -o ControlPersist=30m -o ServerAliveInterval=120 -o ServerAliveCountMax=20 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null '-oProxyCommand=ssh -i $JH3_SSH_PRIVATE_KEY -W %h:%p -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oProxyCommand="ssh -i $JH2_SSH_PRIVATE_KEY -W 198.18.182.66:22 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oProxyCommand=\\"ssh -i $JH1_SSH_PRIVATE_KEY -W 146.22.163.188:22 -m hmac-sha1 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null autot...@100.79.241.7\\" auto...@146.22.163.188" conn...@198.18.182.66' -o ControlPath=/tmp/bwrap_20466389__xp6awau/awx_20466389_8ozc1hbg/cp/90ab54c264 129.103.138.122 '/bin/sh -c '"'"'chmod u+x /home/testacc2/.ansible/tmp/ansible-tmp-1679047385.72-56-125137671798457/ /home/testacc2/.ansible/tmp/ansible-tmp-1679047385.72-56-125137671798457/AnsiballZ_synchronize.py && sleep 0'"'"''
<129.103.138.122> (0, '', '')
<129.103.138.122> ESTABLISH SSH CONNECTION FOR USER: testacc2
<129.103.138.122> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="testacc2"' -o ConnectTimeout=60 -C -o ControlMaster=auto -o ControlPersist=30m -o ServerAliveInterval=120 -o ServerAliveCountMax=20 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null '-oProxyCommand=ssh -i $JH3_SSH_PRIVATE_KEY -W %h:%p -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oProxyCommand="ssh -i $JH2_SSH_PRIVATE_KEY -W 198.18.182.66:22 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oProxyCommand=\\"ssh -i $JH1_SSH_PRIVATE_KEY -W 146.22.163.188:22 -m hmac-sha1 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null autot...@100.79.241.7\\" auto...@146.22.163.188" conn...@198.18.182.66' -o ControlPath=/tmp/bwrap_20466389__xp6awau/awx_20466389_8ozc1hbg/cp/90ab54c264 -tt 129.103.138.122 '/bin/sh -c '"'"'sudo -H -S -n  -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-bexovkdvovirkrfatdyeahwvoismueds ; /usr/bin/python /home/testacc2/.ansible/tmp/ansible-tmp-1679047385.72-56-125137671798457/AnsiballZ_synchronize.py'"'"'"'"'"'"'"'"' && sleep 0'"'"''


What is suspicious... that I could execute the playbook for opposite side and it works fine...

So I am able to copy the file from HOST2 to HOST1.

Could You please support me what is wrong here? Some packages for python are missed on the HOST1 ?  I am a bit confused because seems that we have the same packages installed on both sides.

Axel Kurowski

unread,
Mar 22, 2023, 3:49:01 AM3/22/23
to Ansible Project
I have found the error.. I have registered manually the public key from root host1 into the target user host2. It works fine.
Reply all
Reply to author
Forward
0 new messages