]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
Handle multiple keys in ldap correctly
authorPeter Palfrader <peter@palfrader.org>
Thu, 14 May 2015 16:04:39 +0000 (18:04 +0200)
committerPeter Palfrader <peter@palfrader.org>
Thu, 14 May 2015 16:04:39 +0000 (18:04 +0200)
modules/ssh/templates/authorized_keys.erb

index a11a6111487a19073e9b5de5efddc5fc47730e33..2a56710684b489fcdc5208098bc8c334ca6bea36 100644 (file)
@@ -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