Deploying a zip from puppet master

76 views
Skip to first unread message

Daniel Schaefer

unread,
Mar 13, 2014, 10:11:06 AM3/13/14
to example42-pu...@googlegroups.com
I have a need to deploy and extract a zip file that is not publicly available and cannot be retrieve with curl, wget, or the like. I will be storing the zip file in modules/[my_module]/file/ and I will need to extract it to a puppet client in a specified directory. This is apparently new to me, since I don't have any examples to go off of.

My question is, is there a puppi class/define or another example42 module to do this or is this something that needs to be done outside of example42?

Thanks in advance and I'm sorry if this is trivial.

Alessandro Franceschi

unread,
Mar 13, 2014, 10:17:54 AM3/13/14
to example42-pu...@googlegroups.com
If you store the zip in your module's files directory you can simply retrieve it on the clients with a normal file resource and the source argument accordingly set (note that generally is not recommended to use it to fetch big files, as, for example, Puppet needs to make a checksum both on client and master to verify if it has been changed) and then have an exec resource which has refreshonly => true , subscribes the above file resource and runs the extraction command.
In ex42 modules you can use puppi::netinstall to retrieve and unpack files, but, it can't be applied to your case, since the file can't be retrieved with a simple curl/wget.
 
Al

Daniel Schaefer

unread,
Mar 13, 2014, 10:55:08 AM3/13/14
to example42-pu...@googlegroups.com
Thanks Al! I took your suggestion to use puppi::netinstall, because I wanted to use the resources after the retrieve anyway. What I did was I pushed the file to /var/tmp on the remote server using the file define. Then I ran puppi::netinstall, but using "test" as the $retrieve_command. So the retrieve command isn't really retrieving anything so much as just checking for the file. This worked like a charm! See the link for my full solution.

Reply all
Reply to author
Forward
0 new messages