Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
## 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
This paste will be private.
From the Design Piracy series on my blog: