ansible synchronize & vagrant

70 views
Skip to first unread message

Bendt, Alphonse

unread,
May 31, 2016, 9:38:13 AM5/31/16
to ansible...@googlegroups.com

Hi there,

i am trying to ansible for provisioning of a vagrant box.
It seems that the synchronize task does not work reliably.
It seems that rsync targets the host machine instead of the vagrant target machine:

Ansible Task:
- name: sync Jenkins Dockerfile
  synchronize: src=docker/ dest=/tmp/docker-jenkins rsync_opts="-vv" rsync_path="sudo rsync“

the folder ‚docker' on the host contains some configuration files

output of ansible run:
TASK [jenkins-docker : sync Jenkins Dockerfile] ********************************
task path: /Users/abendt/Projekte/ContinuousDelivery/roles/jenkins-docker/tasks/main.yml:7
changed: [ci] => {"changed": true, "cmd": "/opt/local/bin/rsync --delay-updates -F --compress --archive --rsh '/usr/bin/ssh -i /Users/abendt/Projekte/ContinuousDelivery/.vagrant/machines/ci/virtualbox/private_key -S none -o StrictHostKeyChecking=no -o Port=2222' --rsync-path=\"sudo rsync\" -vv --out-format='<<CHANGED>>%i %n%L' \"/Users/abendt/Projekte/ContinuousDelivery/roles/jenkins-docker/docker/\" \"/tmp/docker-jenkins\"", "msg": "building file list ... done\ncreated directory /tmp/docker-jenkins\ndelta-transmission disabled for local transfer or --whole-file\ncd++++++++++ ./\n>f++++++++++ Dockerfile\n>f++++++++++ addJdk.groovy\n>f++++++++++ addMaven.groovy\n>f++++++++++ addUsers.groovy\n>f++++++++++ plugins.txt\ntotal: matches=0  hash_hits=0  false_alarms=0 data=1564\n\nsent 1,183 bytes  received 227 bytes  2,820.00 bytes/sec\ntotal size is 1,564  speedup is 1.11\n", "rc": 0, "stdout_lines": ["building file list ... done", "created directory /tmp/docker-jenkins", "delta-transmission disabled for local transfer or --whole-file", "cd++++++++++ ./", ">f++++++++++ Dockerfile", ">f++++++++++ addJdk.groovy", ">f++++++++++ addMaven.groovy", ">f++++++++++ addUsers.groovy", ">f++++++++++ plugins.txt", "total: matches=0  hash_hits=0  false_alarms=0 data=1564", "sent 1,183 bytes  received 227 bytes  2,820.00 bytes/sec", "total size is 1,564  speedup is 1.11“]}

afterwards the folder /tmp/docker-jenkins exists locally but not in the vagrant box

I found some bug reports that seem to indicate that this particular problem is solved: https://github.com/ansible/ansible/pull/14140
However it is not working for me.

Is anyone using this combination successfully and can show me a working configuration snippet?

best regards,
  Alphonse Bendt

Reply all
Reply to author
Forward
0 new messages