]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/debian-org/lib/facter/cluster.rb
expand hiera data and add cluster info to motd
[dsa-puppet.git] / modules / debian-org / lib / facter / cluster.rb
1 Facter.add('cluster') do
2   setcode do
3     if system('/usr/sbin/gnt-cluster getmaster >/dev/null')
4       require 'json'
5       config = '/var/lib/ganeti/config.data'
6       if FileTest.exist?(config)
7         JSON.parse(File.read(config))['cluster']['cluster_name']
8       else
9         ''
10       end
11     end
12   end
13 end