Report abuse

output

1
2
3
4
5
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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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