summaryrefslogtreecommitdiff
path: root/puppet
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2014-11-25 16:25:43 -0800
committerelijah <elijah@riseup.net>2014-11-25 16:25:43 -0800
commit83267a00f272a6f3f52a66eca44d9ca85924cc8e (patch)
tree03cd1f3427de20b800e2c28e0931667d0dcbf8f5 /puppet
parentde51b83384d97a67cdbdf1992ba9ad771a292c5d (diff)
include a host information in ssh_config for ever possible host a given node might communicate with. this includes port and host key algorithm. closes #6432
Diffstat (limited to 'puppet')
-rw-r--r--puppet/modules/site_sshd/templates/ssh_config.erb17
1 files changed, 17 insertions, 0 deletions
diff --git a/puppet/modules/site_sshd/templates/ssh_config.erb b/puppet/modules/site_sshd/templates/ssh_config.erb
index 7e967413..36c0b6d5 100644
--- a/puppet/modules/site_sshd/templates/ssh_config.erb
+++ b/puppet/modules/site_sshd/templates/ssh_config.erb
@@ -21,3 +21,20 @@ Host *
StrictHostKeyChecking no
<% end -%>
+#
+# Tell SSH what host key algorithm we should use. I don't understand why this
+# is needed, since the man page says that "if hostkeys are known for the
+# destination host then [HostKeyAlgorithms default] is modified to prefer
+# their algorithms."
+#
+
+<% @hosts.sort.each do |name, host| -%>
+Host <%= name %> <%= host['domain_full'] %> <%= host['domain_internal'] %> <%= host['ip_address'] %>
+<% if host['host_pub_key'] -%>
+HostKeyAlgorithms <%= host['host_pub_key'].split(" ").first %>
+<% end -%>
+<% if host['port'] -%>
+Port <%= host['port'] %>
+<% end -%>
+
+<% end -%>