When I am downloading a tar.gz file and unarchiving it using the unarchive module, ansible fails with “Failed to find handler for "/usr/share/openjdk-9.0.4_linux-x64_bin.tar.gz". Make sure the required command to extract the file is installed. Commands "gtar" and "tar" not found. Command "unzip" not found.”
But when I run just the piece of code unarchive module code on an already present tar.gz file, ansible works perfectly. I already have all the missing packages installed in the box.
Thanks
ansible 2.4.3.0
the is the piece of code which fails:
- name: downloading java
get_url:
url: https://download.java.net/java/GA/jdk9/9.0.4/binaries/openjdk-9.0.4_linux-x64_bin.tar.gz
dest: /usr/share/
owner: root
group: root
mode: 0644
- name: unarchiving java source file
unarchive:
src: /usr/share/openjdk-9.0.4_linux-x64_bin.tar.gz
dest: /usr/share/
owner: root
group: root
mode: 0644
the piece of code which succeeds:
- name: unarchiving java source file
unarchive:
src: /usr/share/openjdk-9.0.4_linux-x64_bin.tar.gz
dest: /usr/share/
owner: root
group: root
mode: 0644