【发布时间】:2020-03-06 15:19:49
【问题描述】:
我使用 Ansible 在 EC2 上运行 AmazonLinux2。但是,执行 Unarchive 命令时,会显示以下错误。
"Failed to find handler for \"/tmp/hoge.db.gz\".
Make sure the required command to extract the file is installed.
Command \"/usr/bin/unzip\" could not handle archive. Command \"/usr/bin/gtar\" could not handle archive."
PlayBook的内容如下。
- name: Unarchive hoge
become: yes
unarchive:
src: /tmp/hoge.db.gz
dest: /root/fuga/
remote_src: yes
以下是我已检查以确定错误原因的信息。
- 解压需要命令
[root@ip- ~]# which gtar
/usr/bin/gtar
[root@ip- ~]# which unzip
/usr/bin/unzip
[root@ip- ~]# which zipinfo
/usr/bin/zipinfo
- 路径
- debug:
var: ansible_env.PATH
"ansible_env.PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin"
【问题讨论】:
标签: ansible