Displaying 1 result from an estimated 1 matches for "hour_from_fqdn".
2007 May 01
8
Custom functions and facts
...39;m seeing is that Facter[''fqdn''].value is always returning the
fqdn of the puppetmaster host. I was expecting the fqdn of the client
host.
Here''s the code that is exhibiting this behavior:
require ''md5''
module Puppet::Parser::Functions
newfunction(:hour_from_fqdn, :type => :rvalue) do |args|
MD5.new(Facter[''fqdn''].value).to_s.hex % 4
end
end
I''ve managed to get this working by using $fqdn inside my node
definition and passing it through to my custom definition like this:
node ''somenode.domain.com'' {...