module - ansible - 取消归档 - 找不到输入文件

标签 module tar ansible unpack

当 Ansible (1.9.2) 尝试解压文件时,我收到此错误。

19:06:38 TASK: [jmeter | unpack jmeter] ************************************************ 
19:06:38 fatal: [jmeter01.veryfast.server.jenkins] => input file not found at /tmp/apache-jmeter-2.13.tgz or /tmp/apache-jmeter-2.13.tgz
19:06:38 
19:06:38 FATAL: all hosts have already failed -- aborting
19:06:38 

我检查了目标服务器,/tmp/apache-jmeter-2.13.tgz 文件存在并且它具有有效的权限(为了测试我也给出了 777,即使不是 reqd,但仍然收到上述错误消息)。

我还检查了该文件的 md5sum(将其与 apache jmeter 网站上的内容进行比较)——它匹配!

# md5sum apache-jmeter-2.13.tgz|grep 53dc44a6379b7b4a57976936f3a65e03
53dc44a6379b7b4a57976936f3a65e03  apache-jmeter-2.13.tgz

当我对此文件使用 tar -xvzf 时,tar 能够在 .tgz 文件中显示/提取其内容。

我可能会错过什么?此时,我想知道 Ansible 中的 unarchive 方法/模块一定有一些错误。

我最后的手段(如果我无法在 Ansible 中解压工作)是使用 Command: "tar -xzvf/tmp/....." 但我不这样做我想把它作为我的第一选择。

最佳答案

Unarchive 的默认行为就是在本地系统上找到该文件,将其复制到远程,然后解压。我怀疑如果您收到文件未找到错误,那么您需要在任务中指定 copy=no

关于module - ansible - 取消归档 - 找不到输入文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32698529/

相关文章:

configuration - Docker 容器和 Ansible Playbook 有什么区别?

windows - 如何正确循环遍历 Ansible 中 block 内任务的文件?

ansible - 我可以在私有(private) git 存储库中添加角色作为 Ansible 中的元/依赖项吗?

perl - 如何在没有安装权限的情况下使用新的 Perl 模块?

module - 如何为 ionic 2 发布自己的 npm 模块?

javascript - 如何在 NodeJS 上使用 nanoid 模块?

command-line - .tar 与 .tgz...有什么区别?

python-2.7 - python中的双点运算符(..)是什么?

unix - tar 和 zip 有什么区别?

bash 脚本使用单词指示符和单词修饰符来自动化 wget tar cd