diff --git a/manifests/deploy.pp b/manifests/deploy.pp index 8c89586..b575b9e 100644 --- a/manifests/deploy.pp +++ b/manifests/deploy.pp @@ -8,6 +8,7 @@ $password = undef, #: https or ftp user password or https certificate password $environment = undef, #: environment variable for settings such as http_proxy $strip = undef, #: extract file with the --strip=X option. Only works with GNU tar. + $use_7zip = false, #: alternative to unzip command on Windows $unzip_opts = '', #: additional options to pass the unzip command. $timeout = undef, #: the time to wait for the file transfer to complete $user = undef, #: extract file as this user @@ -35,6 +36,7 @@ group => $group, environment => $environment, strip => $strip, + use_7zip => $use_7zip, unzip_opts => $unzip_opts, subdir => $caller_module_name, creates => $creates, diff --git a/manifests/extract.pp b/manifests/extract.pp index d5242b2..d9496a3 100644 --- a/manifests/extract.pp +++ b/manifests/extract.pp @@ -9,6 +9,7 @@ $group = undef, #: extract file as this group. $environment = undef, #: environment variables. $strip = undef, #: extract file with the --strip=X option. Only works with GNU tar. + $use_7zip = false, #: alternative to unzip command on Windows $unzip_opts = '', #: additional options to pass the unzip command. $subdir = $caller_module_name #: subdir per module in staging directory. ) { @@ -92,7 +93,11 @@ } /.zip$/: { - $command = "unzip ${unzip_opts} ${source_path}" + if $use_7zip { + $command = "7z x ${source_path} ${unzip_opts}" + } else { + $command = "unzip ${unzip_opts} ${source_path}" + } } /(.war|.jar)$/: {