I need to download the ansible tar from http://archive.apache.org/dist/cassandra/2.2.9/ and install it on multiple servers.
Rather than downloading the file on each host I would like to download the file on the playbook host then copy it to each host for install (to save bandwidth).
In my testing I have managed to copy the tar from the host to the servers
- name: Copy Cassandra
copy:
src: "{{item}}"
dest: "{{tmp_dir}}"
with_items:
- "{{cassandra_tar}}"
However, I have manually put the cassandra tar in the right place before running the playbook.
How do I make ansible check if the file exists in the playbook host and only download the tar if it doesn't exist?
force
option. – Konstantin Suvorov