Facter.add('cluster') do
setcode do
- if system('/usr/sbin/gnt-cluster getmaster')
+ if system('/usr/sbin/gnt-cluster getmaster >/dev/null')
require 'json'
config = '/var/lib/ganeti/config.data'
if FileTest.exist?(config)
end
+if hiera('cluster')
+ purp += "\nganeti cluster: " + hiera('cluster') + " contains these nodes:\n"
+ hiera_array('nodes').each do |node|
+ purp += "\t" + node
+ if node.eql?(fqdn)
+ purp += " (this system)"
+ end
+ purp += "\n"
+ end
+ purp += "\n"
+end
+
+
if scope.lookupvar('site::nodeinfo').has_key?('footer')
purp += "\n" + wrap(scope.lookupvar('site::nodeinfo')['footer']) + "\n"
end
+
purp
-%>