From: Stephen Gran Date: Sun, 31 May 2015 14:37:03 +0000 (+0100) Subject: hiera now passes through nil correctly X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=502a768217c9d799d305aca3585b8049d057cd7c;p=mirror%2Fdsa-puppet.git hiera now passes through nil correctly Signed-off-by: Stephen Gran --- diff --git a/modules/motd/templates/motd.erb b/modules/motd/templates/motd.erb index 6b4f640ad..56328234f 100644 --- a/modules/motd/templates/motd.erb +++ b/modules/motd/templates/motd.erb @@ -107,7 +107,7 @@ unless vms.empty? end -if scope.lookupvar('::cluster').to_s != 'undefined' +if scope.lookupvar('::cluster') purp += "\n This server is a node in ganeti cluster: " purp += scope.lookupvar('::cluster').to_s + ":\n" purp += "\t" + scope.lookupvar('::cluster_nodes').split.sort.map{ |x| x.split('.')[0] }.join(", ") + ".\n" diff --git a/modules/ssh/templates/authorized_keys.erb b/modules/ssh/templates/authorized_keys.erb index 2a5671068..9963270f1 100644 --- a/modules/ssh/templates/authorized_keys.erb +++ b/modules/ssh/templates/authorized_keys.erb @@ -11,7 +11,7 @@ localkeys %> <%= ganetikeys = [] - if scope.lookupvar('::cluster').to_s != 'undefined' + if scope.lookupvar('::cluster') 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]}"