I'm trying to use get_url to download a file to a group of hosts. My play
looks like this:
---
- hosts: webservers
remote_user: ec2-user
tasks:
- name: download jar
get_url:
url: https://s3-us-west-2.amazonaws.com/bucket/some.jar
dest: /home/ec2-user/management/jars/some.jar
notify: restart_service
- name: start_service
service: name=gw-management state=started
sudo: yes
handlers:
- name: restart_service
service: name=gw-management state=restarted
sudo: yes
The file does not seem to be downloaded if it already exists in the dest
directory. If I delete the file first, everything works as expected. The
docs for get_url are slightly confusing and I'm not sure how dest being a
directory affects things. I've also tried using force.
Do I simply need to set the destination to /home/ec2-user/management/jars
without the file name and then, as the docs state, "If dest is a directory,
the file will always be downloaded (regardless of the force option), but
replaced only if the contents changed."? Also, how does ansible determine
contents have changed, is it hashing the contents?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/8eb9da33-a72f-4638-9c6d-ab01549b7fc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.