[chef] RE: Re: Windows system standard program for unzip-ing archives?


Chronological Thread 
  • From: Adam Edwards < >
  • To:
  • Subject: [chef] RE: Re: Windows system standard program for unzip-ing archives?
  • Date: Thu, 20 Nov 2014 22:27:09 -0800

The windows cookbook has a resource called windows_zipfile that can unzip files for you. One issue with that is that it downloads external software called 7zip to do this, so it requires that your nodes have Internet access at the time the execute a recipe (at least the first time). You can read about it here: https://github.com/opscode-cookbooks/windows/blob/master/README.md.

 

If you’re using PowerShell 4.0 or higher, PowerShell’s DSC feature has an Archive resource built in which  does this and it can be accessed via Chef’s dsc_script resource. See the reference to “Archive” at https://docs.getchef.com/resource_dsc_script.html which shows a sample that unzips a file.

 

As Greg mentions, .net has some facility to do this, and since you can access .net assemblies from PowerShell, there is a way to do this via PowerShell which can easily be accessed from Chef (e.g. the powershell_script resource).

 

-Adam

 

From: Greg Zapp [mailto: "> ]
Sent: Thursday, November 20, 2014 10:10 PM
To: ">
Subject: [chef] Re: Windows system standard program for unzip-ing archives?

 

Hi brad, I'm on the way to the office holiday party but .net most likely has an archive class to handle zip, and powershell can use .net classes.  I could swear chefs windows client handles zip via a ruby gem though.. Maybe its in the windows or artifact cookbook.   I unzip quite a few things myself on windows with chef.

-Greg

On Nov 21, 2014 6:54 PM, "Brad Knowles" < "> > wrote:

Folks,

So, I've been trying to write some cross-platform Chef code for a customer, and one of the things we need to do is to take a zip archive of a package written in Java, and deploy that.  The zip archive is completely self-contained, we don't need to install it as an OS-level package or anything -- we just need to un-zip it into an appropriate directory structure, and then run the appropriate included .sh or .BAT files.

This worked fine on RHEL5.  But I was astonished to find that there is apparently no standard tool to handle this kind of thing on Win2k3 or Win2k8.

Am I missing something obvious here?  I mean, I can install a package easily enough, but this is a ... sensitive ... customer, and there might have to be a lengthy delay in getting that approved through the change control board.


Any and all ideas or thoughts would be appreciated.  Thanks!

--
Brad Knowles < "> >
LinkedIn Profile: <http://tinyurl.com/y8kpxu>




Archive powered by MHonArc 2.6.16.

§