end
-if not scope.lookupvar('::cluster').to_s.empty?
+if scope.lookupvar('::cluster').to_s != 'undefined'
purp += "\nThis server is a node in ganeti cluster: "
purp += scope.lookupvar('::cluster').to_s + ".\n"
nodes = scope.lookupvar('::cluster_nodes').to_s.split.sort
<%=
ganetikeys = []
allnodeinfo = scope.lookupvar('site::allnodeinfo')
- scope.lookupvar('::cluster_nodes').to_s.split.sort.each do |node|
- if allnodeinfo.has_key?(node)
- ganetikeys << "# for ganeti: #{allnodeinfo[node]['hostname'].to_s}"
- ganetikeys << "from=\"#{allnodeinfo[node]['ipHostNumber'].join(',')}\" #{allnodeinfo[node]['sshRSAHostKey'].to_s}"
- else
- ganetikeys << "# host #{node} not found in allnodeinfo"
+ if scope.lookupvar('::cluster').to_s != 'undefined'
+ scope.lookupvar('::cluster_nodes').to_s.split.sort.each do |node|
+ if allnodeinfo.has_key?(node)
+ ganetikeys << "# for ganeti: #{allnodeinfo[node]['hostname'].to_s}"
+ ganetikeys << "from=\"#{allnodeinfo[node]['ipHostNumber'].join(',')}\" #{allnodeinfo[node]['sshRSAHostKey'].to_s}"
+ else
+ ganetikeys << "# host #{node} not found in allnodeinfo"
+ end
end
end
ganetikeys.join("\n");