]> git.donarmstrong.com Git - dsa-puppet.git/blob - files/etc/puppet/lib/puppet/parser/functions/extractnodeinfo.rb
Add ability to extract keys from nodeinfo
[dsa-puppet.git] / files / etc / puppet / lib / puppet / parser / functions / extractnodeinfo.rb
1 module Puppet::Parser::Functions
2   newfunction(:extractnodeinfo, :type => :rvalue) do |args|
3
4     nodeinfo = args[0]
5     key      = args[1]
6
7     if nodeinfo.has_key?(key)
8       return nodeinfo[key]
9     else
10       return "false"
11     end
12   end
13 end