Added server_id fact

use mac address for "guaranteed" uniqueness ;)
This commit is contained in:
Nick Le Mouton 2014-11-06 15:14:35 +13:00 committed by Igor Galić
parent 1a572d6070
commit dbf54cefe8

9
lib/facter/server_id.rb Normal file
View file

@ -0,0 +1,9 @@
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