view modules/mysql/lib/facter/mysql_server_id.rb @ 244:48d3a1948e4d

Update MySQL module
author IBBoard <dev@ibboard.co.uk>
date Sat, 21 Dec 2019 14:11:43 -0500
parents
children 668df4711671
line wrap: on
line source

def mysql_id_get
  Facter.value(:macaddress).split(':')[2..-1].reduce(0) { |total, value| (total << 6) + value.hex }
end

Facter.add('mysql_server_id') do
  setcode do
    begin
      mysql_id_get
    rescue
      nil
    end
  end
end