end
Facter.add('cluster_nodes') do
setcode do
- open('/var/lib/ganeti/ssconf_node_list').read().split()
+ open('/var/lib/ganeti/ssconf_node_list').read().split().join(" ")
end
end
end
if scope.lookupvar('::cluster').to_s != 'undefined'
purp += "\n This server is a node in ganeti cluster: "
purp += scope.lookupvar('::cluster').to_s + ":\n"
- purp += "\t" + scope.lookupvar('::cluster_nodes').sort.map{ |x| x.split('.')[0] }.join(", ") + ".\n"
+ purp += "\t" + scope.lookupvar('::cluster_nodes').split.sort.map{ |x| x.split('.')[0] }.join(", ") + ".\n"
if @lsbmajdistrelease >= '7'
purp += ""
ganetikeys = []
allnodeinfo = scope.lookupvar('site::allnodeinfo')
if scope.lookupvar('::cluster').to_s != 'undefined'
- scope.lookupvar('::cluster_nodes').sort.each do |node|
+ scope.lookupvar('::cluster_nodes').split.sort.each do |node|
if allnodeinfo.has_key?(node)
ganetikeys << "# for ganeti cluster #{scope.lookupvar('::cluster').to_s}: #{allnodeinfo[node]['hostname'][0]}"
ganetikeys << "from=\"#{allnodeinfo[node]['ipHostNumber'].join(',')}\" #{allnodeinfo[node]['sshRSAHostKey'][0]}"