module-puppetlabs-mysql/lib/facter/mysql_server_id.rb
2016-08-09 17:05:22 -07:00

9 lines
205 B
Ruby

def get_mysql_id
Facter.value(:macaddress).split(':')[2..-1].inject(0) { |total,value| (total << 6) + value.hex }
end
Facter.add("mysql_server_id") do
setcode do
get_mysql_id rescue nil
end
end