部署某環境的時候,我使用ansible的unarchive模塊解壓某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 archive. Command \"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
微信公衆號:測試生財(按期分享獨家內容和資源)