I'm using unarchive module of Ansible and that doesn't seem to be working to extract the war file. It works fine for .tar.
There's also a switch setype
: "type part of SELinux file context" that I'm not sure if can be used to set the type of file as war.
I tried this:
-name: Unpack war
unarchive: src=~/wars/mywar.war
dest=/tmp/deploy
setype=war
copy=no
it gives error: msg: Failed to find handler to unarchive. Make sure the required command to extract the file is installed.
When I don't use 'setype' I get exact same error again.
How can I extract war file using Ansible?
win_unzip module – Unzips compressed files and archives on the Windows node — Ansible Documentation. You are reading the latest (stable) community version of the Ansible documentation.
They can be run on a web server using a supporting program such as the Tomcat Web Application Manager within Apache. Since WAR files are saved in an archive format, the contents of a WAR file can be extracted using a file decompression utility like Stuffit Expander.
Solution. WAR file is just a JAR file, to extract it, just issue following jar command – “ jar -xvf yourWARfileName.
You should be able to unarchive a .war file using Ansible. Are you sure that 'unzip' is installed & the 'unzip' command available on your target system?
As per Ansible Documentation: "requires gtar/unzip command on target host"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With