On Monday, 24 June 2013 15:40:14 UTC+10, David Schmitt wrote: > Functions are executed on the master, not on the agent, so they won't do > what you need. >
Yes I keep forgetting that. > > If you really want to run code on the client it has to be a type/provider. > I was hoping to get something like to be considered to be built into Puppet. > > If it is only "test -e", use "File%creates". > I know about "creates" parameter, but there are other tests which could be easily done with a ruby function/system-call (e.g. file size, type, content etc). > Regards, David > > On 24.06.2013 03:59, Michael Dodwell wrote: > > Take a look at > > http://docs.puppetlabs.com/guides/custom_functions.html you could write > > your own fuctions to give you something like this. > > > > Puppet hasn't really been designed to be low overhead (with more of a > > focus on simplicity) and i think the least of it's performance problems > > come from the fact that it uses an external fork for exec checks. > > > > On Sunday, June 23, 2013 8:39:57 PM UTC+10, Amos Shapira wrote: > > > > Hi, > > > > A little annoyance about "exec" that bothers me is that there is no > > way to use "unless"/"onlyif" except with external commands, even if > > a simple Ruby function could be used to execute the test. > > > > e.g. "onlyif => 'test -d /data'" will fork and exec "test" to do a > > simple stat(2) which can be done with much less overhead with Ruby's > > "File.directory?('/data')". > > > > How about allowing passing a none-string value to Exec's > > onlyif/unless attributes, and consider that as the result? If it's a > > string then it will be treated as today, otherwise it will be > > treated as a boolean. > > > > I don't think this will break any backward compatibility since all > > Exec's currently expect strings to execute. > > > > Cheers, > > > > --Amos > > > > -- > > 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 [email protected] <javascript:>. > > To post to this group, send email to > > [email protected]<javascript:>. > > > Visit this group at http://groups.google.com/group/puppet-users. > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
