Browse Source

Update ssh configuration to handle to type of ssh keys following OS version

Emmanuel Bouthenot 9 years ago
parent
commit
294094d2ad
2 changed files with 4 additions and 2 deletions
  1. 0 1
      roles/common/defaults/main.yml
  2. 4 1
      roles/common/templates/ssh/sshd_config.j2

+ 0 - 1
roles/common/defaults/main.yml

@@ -40,7 +40,6 @@ with_mail_aliases: False
 with_ssh: True
 ssh_ports:
   - 22
-ssh_ecdsa_key: True
 ssh_usedns: True
 ssh_allowed_users: Null
 ssh_allowed_groups:

+ 4 - 1
roles/common/templates/ssh/sshd_config.j2

@@ -17,9 +17,12 @@ Protocol 2
 # HostKeys for protocol version 2
 HostKey /etc/ssh/ssh_host_rsa_key
 HostKey /etc/ssh/ssh_host_dsa_key
-{% if ssh_ecdsa_key %}
+{% if ansible_lsb.major_release|int >= 7 %}
 HostKey /etc/ssh/ssh_host_ecdsa_key
 {% endif %}
+{% if ansible_lsb.major_release|int >= 8 %}
+HostKey /etc/ssh/ssh_host_ed25519_key
+{% endif %}
 #Privilege Separation is turned on for security
 UsePrivilegeSeparation yes