1 if FileTest.exist?('/usr/sbin/gnt-cluster') and FileTest.exist?('/var/lib/ganeti/config.data')
3 if system('/usr/sbin/gnt-cluster getmaster >/dev/null')
5 json = JSON.parse(File.read('/var/lib/ganeti/config.data'))
6 Facter.add('cluster') do
8 json['cluster']['cluster_name']
11 Facter.add('cluster_nodes') do
13 json['nodes'].keys.join(' ')