How to unzip archive to a master's location

43 views
Skip to first unread message

Malintha Adikari

unread,
Jun 24, 2014, 5:16:36 AM6/24/14
to puppet...@googlegroups.com
Hi,

I keep archive files in my puppet master side. I want to unzip the archive to master's location and do some file replacements and again zip it and then copy it to the agent side. I use following code snippet to unzip it. How can I give an own location (master side location) here ?

exec { "unzip":
command => 'unzip wso2esb-4.8.1.zip',
cwd => "/home/malintha/",
 path      => $command_path,
logoutput => true,
timeout => 3600,
require => File['/home/agent2/adikari11/wso2esb-4.8.1.zip'],
}


here "cwd" means the destination. But this is the agent side destination.I want to set it to master side location

Regards,
Malintha Adikari

Cristian Falcas

unread,
Jul 10, 2014, 7:21:56 PM7/10/14
to puppet...@googlegroups.com
Exec resources are executed on the agent. Functions are executed on master. So you first need a function that does the processing of the original zip and copies the new file to some module, from where you can retrieve it with the file resource.

cristi


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/fa17081c-1b25-4a0d-8b3d-236208caba9f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eric Shamow

unread,
Jul 10, 2014, 7:23:34 PM7/10/14
to puppet...@googlegroups.com



For more options, visit https://groups.google.com/d/optout.



--
Eric Shamow
Methodologies Lead
Puppet Labs
Reply all
Reply to author
Forward
0 new messages