Displaying 1 result from an estimated 1 matches for "mysql_server_ip".
2013 Mar 07
1
HELP:Custom function didn't work
...n rb(this function should return the type I defined
in the database):
#hosttype.rb
require "mysql"
module 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....