Reputation: 31
When I unarchive a file with Ansible, the following error occurred:
Failed to find handler to unarchive. Make sure the required command to extract the file is installed.
Is there a solution without installing the required modules (gtar / unzip).
Upvotes: 3
Views: 13626
Reputation: 686
Make sure the archive file to be extracted is indeed an archive. In my case it was "HTML document, ASCII text, with very long lines (785)".
Example: https://www.apache.org/dyn/closer.lua/zookeeper/zookeeper-3.8.2/apache-zookeeper-3.8.2.tar.gz
Upvotes: 0
Reputation: 11
The same message might be output even if the source file type is not a compressed file.
Upvotes: 1
Reputation: 68469
No. Ansible is no magic, it is an automation tool which relies on commonly available tools to perform its tasks.
Per unarchive documentation:
requires gtar/unzip command on target host
If you look at the source, it looks for gtar
(preferred) then tar
and unzip
.
You can always use command
/ shell
modules to run any command you like, but still you'd need programs to extract from the archives on the target machine.
Upvotes: 7