- 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"}
是否考虑本地文件? ...我正在本地计算机上运行 file 以在远程计算机上解压缩文件。我该如何解决这个问题?
最佳答案
默认情况下,Ansible 会将文件 (src) 从控制计算机复制到远程计算机并取消存档。如果您不希望 Ansible 复制文件,请在任务中设置 copy=no
。
默认情况下,copy
的值为 yes
,因此如果您不这样做,Ansible 将尝试在本地计算机中查找 src
文件设置copy=no
unarchive: src=/root/elasticsearch-1.4.0.tar.gz dest=/tmp/ copy=no
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.
关于unzip - 无法使用 Ansible 解压位于远程 centos 机器上的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34536964/