Reputation: 111
I'm looking for Chef recipe to unzip a file which I downloaded to a Windows 2012 EC2 instance. I'm using the below one. The Zip file (Try.Zip) is saved in C:\data directory and I wish to unzip it to the same folder.
zipfile 'C:\data\Try.zip' do into 'C:\data\' end
Upvotes: 1
Views: 7331
Reputation: 328
You can use batch as resource and used to extract file
batch 'extracting any zip' do
code <<-EOH
tar -xvf pathofzipfile
EOH
action :run
end
Upvotes: 0
Reputation: 111
I was able to use windows_zipfile
command to unzip the file and save in the C:/foldername
location using the below Chef resource definition:
windows_zipfile 'C:/foldername' do
source 'https://location/filename.zip'
action :unzip
overwrite true
end
You can find more information about this resource in Chef documentation
Upvotes: 1