Report abuse

output

Apr 28 13:21:32 monitor1 puppetmasterd[12401]: HUZZAH
Apr 28 13:21:32 monitor1 puppetmasterd[12401]: log2universe
Apr 28 13:21:32 monitor1 puppetmasterd[12401]: universe
Apr 28 13:21:32 monitor1 puppetmasterd[12401]: MATCHED

func

module Puppet::Parser::Functions
   newfunction(:currhost_containedin, :type => :rvalue) do |args|
      fromhosts = lookupvar('fromhosts')
      hostname = lookupvar('hostname')
      Puppet.notice("HUZZAH")
      Puppet.notice("#{fromhosts}")
      Puppet.notice("#{hostname}")
      if fromhosts.include?("#{hostname}")
         Puppet.notice("MATCHED")
      else
         Puppet.notice("NOMATCH")
      end
   end
end