projects
/
mirror
/
dsa-puppet.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
refacter facter code
[mirror/dsa-puppet.git]
/
modules
/
debian-org
/
lib
/
facter
/
cluster.rb
1
if FileTest.exist?('/usr/sbin/gnt-cluster')
2
if system('/usr/sbin/gnt-cluster getmaster >/dev/null')
3
require 'json'
4
config = '/var/lib/ganeti/config.data'
5
Facter.add('cluster') do
6
setcode do
7
JSON.parse(File.read(config))['cluster']['cluster_name']
8
end
9
end
10
end
11
end