ansible:unarchive模块解压报错

前言

部署某环境的时候,我使用ansibleunarchive模块解压某xx.tar.gz文件报错:微信

 "msg": "Failed to find handler for \"/tmp/xxx.tar.gz\". Make sure the required command to extract the file is installed. Command \"/usr/bin/gtar\" could not handle archiveCommand \"unzip\" not found. Command \"/usr/bin/gtar\" found no files in archive运维

使用到ansible的playbook以下:ide

unarchive: src=/tmp/{{module}}.tar.gz dest={{home}}/srv/{{module}}/ copy=no mode=0755工具

分析

从报错信息来看,指的个人tar.gz文件没有合适的解压程序:gtar和unzip没法处理该文件,最后说是gtar发现该archive包中没有文件。学习

最开始我我还觉得是Linux上没有对应解压工具,后来发现是压缩包内容为空致使的。我去该环境上用tar去解压该压缩包,确实没有文件。看报错也是一门艺术,要细看,仔细推敲。。测试

 

快送门:各类学习资料与大厂招聘ui

博主:测试生财(一个不为996而996的测开码农)spa

座右铭:专一测试开发与自动化运维,努力读书思考写做,为内卷的人生奠基财务自由。.net

内容范畴:技术提高,职场杂谈,事业发展,阅读写做,投资理财,健康人生。orm

csdn:https://blog.csdn.net/ccgshigao

博客园:https://www.cnblogs.com/qa-freeroad/

51cto:https://blog.51cto.com/14900374

微信公众号:测试生财(按期分享独家内容和资源)

相关文章
相关标签/搜索