Trevor Vaughan
2007-Mar-05 22:42 UTC
How to add a custom function to return something to file => content
I''m having a heck of a time with this. Basically I want to write a custom function that returns a value to the file content type. Ex: file { /blah: content => do_stuff(option) } I looked at the wiki posting but just haven''t been able to figure out how to make this work. The first error that I get when I try to actually use ''return'' is: "return can''t jump across threads" Ok, so I take away the return and get "err: value is a required option for Puppet::Parser::Resource::Param at <manifest name>" Any suggestions, hints, or other great help? Thanks, Trevor _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
Trevor Vaughan
2007-Mar-05 23:54 UTC
Re: How to add a custom function to return something to file => content
Ok, to answer my own question 1) Don''t be an idiot and put your return value inside of a loop! 2) Be sure to pre-define your return value after your args. If you don''t do 1, you''ll get the errors below and if you don''t do 2, you''ll probably hang your system unless you''re running puppetmasterd inside of hard system limits. *sigh* Trevor On 3/5/07, Trevor Vaughan <peiriannydd@gmail.com> wrote:> > I''m having a heck of a time with this. > > Basically I want to write a custom function that returns a value to the > file content type. > > Ex: file { /blah: content => do_stuff(option) } > > I looked at the wiki posting but just haven''t been able to figure out how > to make this work. > > The first error that I get when I try to actually use ''return'' is: > > "return can''t jump across threads" > > Ok, so I take away the return and get > > "err: value is a required option for Puppet::Parser::Resource::Param at > <manifest name>" > > Any suggestions, hints, or other great help? > > Thanks, > > Trevor >_______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users