From: Peter Palfrader Date: Thu, 14 May 2015 16:04:39 +0000 (+0200) Subject: Handle multiple keys in ldap correctly X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=300123b664fac26364667a397ef3a3fdebffc96e;p=mirror%2Fdsa-puppet.git Handle multiple keys in ldap correctly --- diff --git a/modules/ssh/templates/authorized_keys.erb b/modules/ssh/templates/authorized_keys.erb index a11a61114..2a5671068 100644 --- a/modules/ssh/templates/authorized_keys.erb +++ b/modules/ssh/templates/authorized_keys.erb @@ -15,7 +15,9 @@ localkeys 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]}" + allnodeinfo[node]['sshRSAHostKey'].sort.each do |key| + ganetikeys << "from=\"#{allnodeinfo[node]['ipHostNumber'].join(',')}\" #{key}" + end else ganetikeys << "# host #{node} not found in allnodeinfo" end