From 481d8bdc1edae1a02f6201174fe344ac9fa8968a Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 21 Mar 2024 11:43:08 -0400 Subject: [PATCH] Unarchive get zipinfo on more OS/distros (#82873) Not all implementations use -l as default for -Z on unzip --- changelogs/fragments/unarchive_fix.yml | 2 ++ lib/ansible/modules/unarchive.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/unarchive_fix.yml diff --git a/changelogs/fragments/unarchive_fix.yml b/changelogs/fragments/unarchive_fix.yml new file mode 100644 index 00000000000..dd5e35d7865 --- /dev/null +++ b/changelogs/fragments/unarchive_fix.yml @@ -0,0 +1,2 @@ +bugfixes: + - unarchive modules now uses zipinfo options without relying on implementation defaults, making it more compatible with all OS/distributions. diff --git a/lib/ansible/modules/unarchive.py b/lib/ansible/modules/unarchive.py index 0fbdc1d643e..bb10e3333ec 100644 --- a/lib/ansible/modules/unarchive.py +++ b/lib/ansible/modules/unarchive.py @@ -978,7 +978,7 @@ class TarZstdArchive(TgzArchive): class ZipZArchive(ZipArchive): def __init__(self, src, b_dest, file_args, module): super(ZipZArchive, self).__init__(src, b_dest, file_args, module) - self.zipinfoflag = '-Z' + self.zipinfoflag = '-Zl' self.binaries = ( ('unzip', 'cmd_path'), ('unzip', 'zipinfo_cmd_path'),