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:
">
]
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:
|
Archive powered by MHonArc 2.6.16.