-
Notifications
You must be signed in to change notification settings - Fork 167
Open
Labels
has_prneeds_infosynchronizeIssue and PR for synchronize moduleIssue and PR for synchronize moduleverifiedThis issue has been verified/reproduced by maintainerThis issue has been verified/reproduced by maintainer
Description
SUMMARY
synchronize can't handle paths with spaces in them
ISSUE TYPE
- Bug Report
COMPONENT NAME
synchronize
ANSIBLE VERSION
ansible [core 2.12.1]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/var/lib/jenkins/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
ansible collection location = /var/lib/jenkins/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]
jinja version = 2.10.1
libyaml = True
COLLECTION VERSION
$ ansible-galaxy collection list ansible.posix
# /usr/lib/python3/dist-packages/ansible_collections
Collection Version
------------- -------
ansible.posix 1.3.0
CONFIGURATION
$ ansible-config dump --only-changed
DEFAULT_STDOUT_CALLBACK(/etc/ansible/ansible.cfg) = yaml
OS / ENVIRONMENT
Ubuntu 20.04
ansible installed from ppa:ansible/ansible
$ dpkg -l | grep ansible
ii ansible 5.1.0-1ppa~focal all batteries-included package providing a curated set of Ansible collections in addition to ansible-core
ii ansible-core 2.12.1-1ppa~focal all Ansible IT Automation
STEPS TO REPRODUCE
- hosts: tag_Type_webserver
become: yes
vars:
ansible_python_interpreter: '/usr/bin/python3'
ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
remote_user: jenkins
tasks:
- name: Transfer files to instances
synchronize:
src: "/tmp/dir with spaces"
dest: "/var/www/webapp/releases/build-test/"
links: yes
perms: yes
recursive: yes
times: yes
rsync_opts:
- --chown=www-data:www-data
- --exclude=.git
- --exclude=node_modules
EXPECTED RESULTS
It works
ACTUAL RESULTS
$ ansible-playbook -i aws_ec2.yml test.yml
PLAY [tag_Type_webserver] *************************************************************************************************************************************************
TASK [Gathering Facts] ****************************************************************************************************************************************************
ok: [ec2-3-122-238-188.eu-central-1.compute.amazonaws.com]
TASK [Transfer files to instances] ****************************************************************************************************************************************
fatal: [ec2-3-122-238-188.eu-central-1.compute.amazonaws.com]: FAILED! => changed=false
cmd: /usr/bin/rsync --delay-updates -F --compress --archive --rsh='/usr/bin/ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' --rsync-path='sudo -u root rsync' --chown=www-data:www-data --exclude=.git --exclude=node_modules --out-format='<<CHANGED>>%i %n%L' /tmp/dir with spaces jenkins@ec2-3-122-238-188.eu-central-1.compute.amazonaws.com:/var/www/webapp/releases/build-test/
msg: |-
Warning: Permanently added 'ec2-3-122-238-188.eu-central-1.compute.amazonaws.com,3.122.238.188' (ECDSA) to the list of known hosts.
rsync: link_stat "/tmp/dir" failed: No such file or directory (2)
rsync: link_stat "/var/lib/jenkins/.local/ansible/searchie-dev-eu/with" failed: No such file or directory (2)
rsync: link_stat "/var/lib/jenkins/.local/ansible/searchie-dev-eu/spaces" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1207) [sender=3.1.3]
rc: 23
PLAY RECAP ****************************************************************************************************************************************************************
ec2-3-122-238-188.eu-central-1.compute.amazonaws.com : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
$ ls -la "/tmp/dir with spaces"
total 12
drwxrwxr-x 2 jenkins jenkins 4096 Dec 30 21:40 .
drwxrwxrwt 24 root root 4096 Dec 30 21:39 ..
-rw-rw-r-- 1 jenkins jenkins 5 Dec 30 21:40 test_file
Metadata
Metadata
Assignees
Labels
has_prneeds_infosynchronizeIssue and PR for synchronize moduleIssue and PR for synchronize moduleverifiedThis issue has been verified/reproduced by maintainerThis issue has been verified/reproduced by maintainer