Added server_id fact
use mac address for "guaranteed" uniqueness ;)
This commit is contained in:
parent
1a572d6070
commit
dbf54cefe8
1 changed files with 9 additions and 0 deletions
9
lib/facter/server_id.rb
Normal file
9
lib/facter/server_id.rb
Normal 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
|
Loading…
Reference in a new issue