Hello,

I'm trying to do almost exactly what the cookbook at
http://reductivelabs.com/trac/puppet/wiki/WritingYourOwnFunctions is
doing, namely, adding a custom hash function to determine what time
cron should run.

However, I can't get puppet to find my function.  I've got it
symlinked all over:

[r...@nagios1 functions]# puppetmasterd --configprint libdir
/var/lib/puppet/lib
[r...@nagios1 functions]# ls /var/lib/puppet/lib/puppet/parser/
functions/functions.rb
/var/lib/puppet/lib/puppet/parser/functions/functions.rb
[r...@nagios1 functions]# ls /etc/puppet/modules/puppet/plugins/puppet/
parser/functions/functions.rb
/etc/puppet/modules/puppet/plugins/puppet/parser/functions/
functions.rb

The conents of the file are:
require 'digest/sha1'

module Puppet::Parser::Functions
  newfunction(:minute_from_address, :type => :rvalue) do |args|
    Digest::SHA1.hexdigest(lookupvar('ipaddress')).hex.to_i % 60
  end
end


And the recipe calling it is:
class puppet {

  cron { puppet:
    command => "/etc/init.d/puppet once",
    user => root,
    minute => minute_from_address()
  }
}


But all I ever get is:
Aug  4 22:29:19 toolbox puppetd[10730]: Could not retrieve catalog:
Unknown function minute_from_address at /etc/puppet/modules/puppet/
manifests/init.pp:16 on node xyz

Can someone tell me what I'm doing wrong here?  According to the link
referenced above, puppet should be picking up functions in these
directories.  Even better, is there an accepted way I can tell
puppetmasterd to look for functions in a particular place?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to