'Ansible hangs when copying from a remote host to remote hosts using synchronize module

When you attempt to copy a file from localhost to remote using the answerable synchronize module, the job stops without progressing.

Can anyone help me?

My task is

- name: "Synchronize {{ env }} scrape config"
  synchronize:
    src: "{{ git_dest }}/scrape-config/{{env}}/"
    #dest: "rsync://user@{{ inventory_hostname }}"
    dest: /home1/user
    recursive: yes
    mode: push
  delegate_to: localhost

Execution Results:

<10.106.236.179> PUT /home/runner/.ansible/tmp/ansible-local-20c52b75vf/tmp1taulhz4 TO /home1/user/.ansible/tmp/ansible-tmp-1651209594.0185733-57-206986293233406/AnsiballZ_synchronize.py
<10.106.236.179> SSH: EXEC sftp -b - -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="user"' -o ConnectTimeout=10 -o ControlPath=/runner/cp/afbea03dc8 '[10.106.236.179]'
<10.106.236.179> (0, b'sftp> put /home/runner/.ansible/tmp/ansible-local-20c52b75vf/tmp1taulhz4 /home1/user/.ansible/tmp/ansible-tmp-1651209594.0185733-57-206986293233406/AnsiballZ_synchronize.py\n', b'')
<10.106.236.179> ESTABLISH SSH CONNECTION FOR USER: user
<10.106.236.179> 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="user"' -o ConnectTimeout=10 -o ControlPath=/runner/cp/afbea03dc8 10.106.236.179 '/bin/sh -c '"'"'chmod u+x /home1/user/.ansible/tmp/ansible-tmp-1651209594.0185733-57-206986293233406/ /home1/user/.ansible/tmp/ansible-tmp-1651209594.0185733-57-206986293233406/AnsiballZ_synchronize.py && sleep 0'"'"''
<10.106.236.179> (0, b'', b'/etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (C.UTF-8)\n')
<10.106.236.179> ESTABLISH SSH CONNECTION FOR USER: user
<10.106.236.179> 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="user"' -o ConnectTimeout=10 -o ControlPath=/runner/cp/afbea03dc8 -tt 10.106.236.179 '/bin/sh -c '"'"'sudo -H -S -n  -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-ekfmiaztnebfwmjoijrkjulpubxlgzsp ; /usr/bin/python /home1/user/.ansible/tmp/ansible-tmp-1651209594.0185733-57-206986293233406/AnsiballZ_synchronize.py'"'"'"'"'"'"'"'"' && sleep 0'"'"''


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source