Displaying 1 result from an estimated 1 matches for "host_typ".
Did you mean:
host_type
2013 Mar 07
1
HELP:Custom function didn't work
...Puppet::Parser::Functions
newfunction(:hosttype, :type => :rvalue, :doc => "Gets host type from
db.") do |args|
dbh = Mysql.real_connect("mysql_server_ip", "username", "password",
"puppet")
res = dbh.query("SELECT host_type FROM host_extra_info where
name=''" + args[0] + "''")
# return res.fetch_row
puts res.fetch_row
res.free
dbh.close if dbh
end
end
- Also I wrote a .pp file to test it:
#/tmp/1.pp
$extraaaaa = hosttype("my_h...