2014-11-06 03:14:35 +01:00
|
|
|
def get_mysql_id
|
2016-08-10 01:39:30 +02:00
|
|
|
Facter.value(:macaddress).split(':')[2..-1].inject(0) { |total,value| (total << 6) + value.hex }
|
2014-11-06 03:14:35 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
Facter.add("mysql_server_id") do
|
|
|
|
setcode do
|
2015-06-25 19:23:58 +02:00
|
|
|
get_mysql_id rescue nil
|
2014-11-06 03:14:35 +01:00
|
|
|
end
|
|
|
|
end
|