From: Luca Filipozzi Date: Wed, 16 May 2012 20:21:06 +0000 (+0000) Subject: use Facter to get ganeti nodes rather than hiera X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=a2fbbfd82aa339ef029a12e273009e9ac7690c81;p=mirror%2Fdsa-puppet.git use Facter to get ganeti nodes rather than hiera --- diff --git a/modules/debian-org/lib/facter/cluster.rb b/modules/debian-org/lib/facter/cluster.rb index fda38f98b..c6b00f6b1 100644 --- a/modules/debian-org/lib/facter/cluster.rb +++ b/modules/debian-org/lib/facter/cluster.rb @@ -7,5 +7,10 @@ if FileTest.exist?('/usr/sbin/gnt-cluster') JSON.parse(File.read(config))['cluster']['cluster_name'] end end + Facter.add('cluster_nodes') do + setcode do + JSON.parse(File.read(config))['nodes'].keys + end + end end end diff --git a/modules/motd/templates/motd.erb b/modules/motd/templates/motd.erb index 829994b4b..4dc5ac5a5 100644 --- a/modules/motd/templates/motd.erb +++ b/modules/motd/templates/motd.erb @@ -107,6 +107,9 @@ if scope.lookupvar('::cluster') scope.function_hiera_array('nodes').each do |node| purp += "\t" + node + "\n" end + scope.lookupvar('::cluster_nodes').each do |node| + purp += "\t" + node + "\n" + end end