Execute commands on puppet master

146 views
Skip to first unread message

shashank sinha

unread,
Jul 7, 2014, 5:26:47 AM7/7/14
to puppet...@googlegroups.com
Hello,

I am working on some project where I need to execute scp command on puppet master to copy files from some external server to module/files/* each time when puppet agent pull request received to master.I want something like to copy a file and store it to puppet master /modules/files folder. 

Is it possible to execute scp commands on puppet master (password/password-less environment).

Thanks

jcbollinger

unread,
Jul 8, 2014, 9:34:52 AM7/8/14
to puppet...@googlegroups.com


You can use the built-in generate() function to execute an arbitrary system command on the master during catalog compilation.  You can write a custom function to do the same.  You can run your command via Ruby code embedded in a template, via the template() or inline_template() function.

Having said that, what you are describing sounds like a bad idea to me.  If you want your Puppet clients to obtain files originating on some third server, then why not have them retrieve those files directly?  Doing so would spread the load better, and would minimize the risk of accidentally trashing your Puppet master by copy the wrong file into the wrong place.


John

Reply all
Reply to author
Forward
0 new messages