How to extract war file to target using inaccessible

I am using the unarchive Ansible module and does not seem to work for extracting a war file. It works great for.

There is also a setype switch: "enter part of the context of the SELinux file", which I'm not sure if it can be used to set the file type as a war.

I tried this:

 -name: Unpack war unarchive: src=~/wars/mywar.war dest=/tmp/deploy setype=war copy=no 

it gives an error: msg: Failed to find handler to unarchive. Make sure the required command to extract the file is installed. msg: Failed to find handler to unarchive. Make sure the required command to extract the file is installed.

When I do not use 'setype', I get the same error again.

How can I extract a war file using Ansible?

+6
source share
3 answers

You should be able to unlock the .war file with Ansible. Are you sure unzip is installed and the unzip command is available on your target system?

By Unrelated documentation : "gtar / unzip command is required on the target host"

+1
source

According to the Ansible documentation for the unarchive module , it only supports tar, gzip, bzip2, and xz compressed files. I quickly looked through the source and did not see any signs that it supports unpacking military files. You will probably have to unzip the war file manually by calling / path / to / java / bin / jar manually through a command or shell module.

Edit: In addition, the setype parameter is not intended to indicate the type of archive file. This parameter is associated with SELinux (Security-Enhanced Linux). If you are new to SELinux, you probably will not need to use this option at all.

0
source

I had this error with the ZIP archive - it failed because the ZIP was incomplete. Make sure you can run unzip ~/wars/mywar.war directly on the server, and you can get a more useful error message.

0
source

Source: https://habr.com/ru/post/981333/


All Articles