I am trying to unzip a file on an embedded system that has busy box.
- name: Unarchive media files
unarchive:
src: /home/root/archive.zip
dest: /home/root/
remote_src: yes
I am getting the following error:
fatal: [10.0.6.41]: FAILED! => {"changed": false, "msg": "Failed to find handler for \"/home/root/archive.zip\". Make sure the required command to extract the file is installed.\nCommand \"/bin/tar\" detected as tar type None. GNU tar required.\nCommand \"unzip -Z\" could not handle archive: /usr/bin/unzip: invalid option -- 'Z'\nBusyBox v1.31.1 () multi-call binary.\n\nUsage: unzip [-lnojpq] FILE[.zip] [FILE]... [-x FILE...] [-d DIR]\n\nUnable to find required 'zipinfo' binary in the path."}
Seems like it requires GNU tar? If I run unzip archive.zip directly on the command line on the remote source, it is working.
The last portion of your log says everything:
Ansible tries to run
unzip -Zwhich is the same aszipinfo:From
unarchivemodule documentation:It's not the Ansible way, but if you're on an embedded system and with
busyboxchances are that you will not be able to installzipinfoor any other package. So you can always rununzipdirectly usingcommandorshellmodule: