Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot unzip the file located on remote centos machine using Ansible

- name: Unzip the Elasticsearch file
  unarchive: src=/root/elasticsearch-1.4.0.tar.gz dest=/tmp/


TASK [Unzip the Elasticsearch file]     
*******************************************
fatal: [54.173.94.235]: FAILED! => {"failed": true, "msg": "ERROR! file or module does not exist: /root/elasticsearch-1.4.0.tar.gz"}

Is it consider the local file? ...I am running file on my local machine to unzip file on the remote machine. How can I solve this problem?

like image 816
Tanay Suthar Avatar asked Dec 30 '15 20:12

Tanay Suthar


1 Answers

By default, Ansible copies the file (src) from control machine to the remote machine and unarchives it. If you do not want Ansible to copy the file, set copy=no in your task.

The value of copy is yes by default, so Ansible will try to look for src file in the local machine if you do not set copy=no

unarchive: src=/root/elasticsearch-1.4.0.tar.gz dest=/tmp/ copy=no

Ansible - Unarchive

Copy

If true, the file is copied from local 'master' to the target machine, otherwise, the plugin will look for src archive at the target machine.

like image 126
helloV Avatar answered Oct 03 '22 03:10

helloV