I'm trying to unzip a zip file in a remote server
This file was download first from jFrog repository
The following task should handle the unzip:
- name: Unzip Config.zip file
community.windows.win_unzip:
src: C:\files\config.zip
dest: C:\files\
recurse: no
delete_archive: yes
when: "'center_primary_appservers' in group_names"
But produced the following error
TASK [jfrog : Unzip Config.zip file] **************************************************************************************************************************************task path: /ansible/roles/jfrog/tasks/unzip_config.yml:1
redirecting (type: modules) ansible.builtin.win_unzip to community.windows.win_unzip
Using module file /usr/local/lib/python3.6/site-packages/ansible_collections/community/windows/plugins/modules/win_unzip.ps1
Pipelining is enabled.
<vm1.domain.com> ESTABLISH WINRM CONNECTION FOR USER: DOMAIN\hiddai on PORT 5985 TO vm1.domain.com
fatal: [vm1.domain.com]: FAILED! => {
"changed": false,
"dest": "C:\\files\\",
"msg": "Error unzipping 'C:\\files\\config.zip' to 'C:\\files\\'! Filename contains relative paths which would extract outside the destination: \\src\\Build\\Trunk\\Src\\BuildProcess\\BuildMessageTemplates\\BuildAlertTemplate.htm",
"removed": false,
"src": "C:\\files\\config.zip"
}
META:
META:
META:
META:
META:
META:
META:
META: ran handlers
META: ran handlers
I installed 7Zip on the remote machine and ran the task again - same result
To mention that:
- this zip folder is extract with 7Zip tool only and not with the
Windows built-in unzip tool...
- the
Expand-Archive
command managed to extract the zip folder
What should I do in order the file to be unzip successfully with ansible win_unzip module?