In case anyone is interested in extending the Puppetmaster by writing new functions, I''ve written up some notes on how to do it, gleaned from my own experience earlier today: http://reductivelabs.com/trac/puppet/wiki/WritingYourOwnFunctions Corrections from people who''ve done it before, or who are wanting to do it, as to correctness, clarity, or whatever, are appreciated. And it''s a wiki, so just make the change yourself. <grin> - Matt
Matt, Great tutorial! And, here''s a question for Luke (or anyone else who knows the answer :-)... Would it be possible to make the functions directory configurable in the puppetd.conf file? That way, site specific functions could be placed in ...say... $vardir/site/functions instead of mucking around with the site_ruby/../../../puppet directory. It would just keep everything custom in a nice centralized location. Thanks, Trevor On 2/6/07, Matthew Palmer <mpalmer@hezmatt.org> wrote:> > In case anyone is interested in extending the Puppetmaster by writing new > functions, I''ve written up some notes on how to do it, gleaned from my own > experience earlier today: > > http://reductivelabs.com/trac/puppet/wiki/WritingYourOwnFunctions > > Corrections from people who''ve done it before, or who are wanting to do > it, > as to correctness, clarity, or whatever, are appreciated. And it''s a > wiki, > so just make the change yourself. <grin> > > - Matt > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >_______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On Feb 7, 2007, at 11:21 AM, Trevor Vaughan wrote:> Matt, > > Great tutorial! > > And, here''s a question for Luke (or anyone else who knows the > answer :-)... > > Would it be possible to make the functions directory configurable > in the puppetd.conf file? That way, site specific functions could > be placed in ...say... $vardir/site/functions instead of mucking > around with the site_ruby/../../../puppet directory. > > It would just keep everything custom in a nice centralized location.I think the "right" solution is to support an extra library directory and just add that to the search path. Because of how fond I am of doing things "right", I''ve just added support for this directory (in svn). Note that this directory is really only useful as part of the autoloader, so I''ve only tried to make sure it works there. Changing Ruby''s search path always has ordering problems (i.e., I need to modify the search path before I try to load libraries, and the path will often be modified via the configuration files, which are parsed after most of the puppet libraries are already loaded), so this may not behave quite as you expect. If you use the default locations for directories, you shouldn''t encounter problems, but if you don''t... Well, I''ll fix bugs you encounter if I can, but I can''t make any promises upfront. -- I believe that if it were left to artists to choose their own labels, most would choose none. -- Ben Shahn --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com