What is the purpose of running such function if they are not running on the client?
On Feb 22, 3:22 pm, Gary Larizza <g...@puppetlabs.com> wrote: > Hi there, > > So, functions will ALWAYS be executed on the Puppet MASTER server. They're > never executed on the client. This is why you're seeing the behavior that > you do. > > > > > > > > > > On Wed, Feb 22, 2012 at 12:00 PM, DRivard <dominick.riv...@gmail.com> wrote: > > Hi, > > > I needed a function to check if a file is existing on the Debian box I > > am configuring. So I used this one > > > module Puppet::Parser::Functions > > newfunction(:file_exists, :type => :rvalue) do |args| > > if File.exists?(args[0]) > > return 1 > > else > > return 0 > > end > > end > > end > > > It work greats for some service where apache2 doesn't work for me. > > I am using it this way "file_exists('/etc/init.d/apache2') == 1" if > > this return true I will stop the service or do nothing. > > In my case, the file /etc/init.d/apache2 exists on the puppet master > > running through Passenger, but the puppet client doesn't have it. > > But when I run the puppetd -vt it returns me an error because it's > > thinking the file /etc/init.d/apache2 exists on the puppet client and > > tries to stop the service. > > > do you have any idea, is there a caching system on puppet client where > > we could delete a cached function? > > > Thank you! > > > -- > > You received this message because you are subscribed to the Google Groups > > "Puppet Users" group. > > To post to this group, send email to puppet-users@googlegroups.com. > > To unsubscribe from this group, send email to > > puppet-users+unsubscr...@googlegroups.com. > > For more options, visit this group at > >http://groups.google.com/group/puppet-users?hl=en. > > -- > > Gary Larizza > Professional Services Engineer > Puppet Labs -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.