module-puppetlabs-mysql/lib/facter/mysql_server_id.rb
Igor Galić d7077b43d2 document mysql_server_id fact and add spec tests
add spec tests, expand documentation to mention lo behaviour
also, rename fact, for, consistency.
2015-03-04 08:56:45 +01:00

9 lines
187 B
Ruby

def get_mysql_id
Facter.value(:macaddress).split(':').inject(0) { |total,value| (total << 4) + value.hex }
end
Facter.add("mysql_server_id") do
setcode do
get_mysql_id
end
end