ansible.posix icon indicating copy to clipboard operation
ansible.posix copied to clipboard

Ansible synchronize module fails with error 'No such file or directory (2)'

Open Sreekanthcp opened this issue 1 year ago • 0 comments

SUMMARY

Hi team,

The scenario where i am receiving the error is : I am trying to synchronize files from an application directory on server1 to other 5 application servers. I am using the synchronize module to do so. Once the playbook is executed few files are copied over to all 5 servers and few are not. A temporary directory .tmp is created in the destination location and initially the files are copied over to that location. once on the final stage when the files are moved or renamed the below error is received. The error is received for multiple files on all the 5 servers. kerberos protocol is used between all servers. rsync: rename failed for "/home/testuser/appdir/_test.txt" (from .tmp/_test.txt):

To avoid timeouts i have increased the values for all possibility. ansible.cfg has the below values.

[defaults] host_key_checking = False display_skipped_hosts = false remote_tmp = /tmp interpreter_python = /usr/bin/python2 callback_whitelist = profile_tasks timeout = 7200 forks = 100 [callback_profile_tasks] sort_order = none [ssh_connection] ssh_args=-C -o ControlMaster=auto -o ControlPersist=1200s -o BatchMode=yes retries = 3 pipelining = True module_lang = en_US.UTF-8 module_set_locale = True [persistent_connection] command_timeout = 7200 connect_timeout = 7200

ISSUE TYPE
  • Bug Report
COMPONENT NAME

synchronize

ANSIBLE VERSION
ansible 2.9.19
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/user1/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, May 27 2022, 11:27:32) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
COLLECTION VERSION

CONFIGURATION
DEFAULT_CALLBACK_WHITELIST(/etc/ansible/ansible.cfg) = [u'timer']
DEFAULT_REMOTE_PORT(/etc/ansible/ansible.cfg) = 22
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) 
OS / ENVIRONMENT

Red Hat Enterprise Linux Server release 7.9 (Maipo)

STEPS TO REPRODUCE
name: Sync applicatives
synchronize:
src: "/home/user1/appdir/"
dest: "/home/user2/appdir/"
mode: push
rsync_path:
rsync_opts: "--exclude=/logs/ --exclude=*.log"
delegate_to: "remote.test.com"
environment:
KRB5CCNAME: "~/testuser.tgt"
EXPECTED RESULTS

I expect all the files from server1 to be to be copied completely without any disturbances to all the servers.

ACTUAL RESULTS

Sreekanthcp avatar May 31 '23 12:05 Sreekanthcp