Skip to content
This repository was archived by the owner on Dec 26, 2020. It is now read-only.

Commit 34144cf

Browse files
committed
use new kex for redhat family 7 in ssh client config and fix for wrong macs setting
Signed-off-by: Patrick Münch <patrick.muench1111@gmail.com>
1 parent 92141dc commit 34144cf

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

templates/openssh.conf.j2

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ StrictHostKeyChecking ask
7474
{% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04') or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8') or (ansible_os_family in ['Oracle Linux', 'RedHat'] and ansible_distribution_major_version >= '7') -%}
7575
MACs {{ ssh_macs_66_default | join(',') }}
7676
{% elif ansible_os_family in ['Oracle Linux', 'RedHat'] and ansible_distribution_major_version <= '6' -%}
77-
MACs {{ ssh_macs_53_default | join(',') }}
77+
MACs {{ ssh_macs_53_default | join(',') }}
78+
{% else -%}
79+
MACs {{ ssh_macs_59_default | join(',') }}
7880
{% endif %}
7981
{% endif %}
8082

@@ -85,14 +87,14 @@ StrictHostKeyChecking ask
8587
# Weak kex is sometimes required if older package versions are used
8688
# eg ruby's Net::SSH at around 2.2.* doesn't support sha2 for kex, so this will have to be set true in this case.
8789
#
88-
{% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04') or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8') -%}
90+
{% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04') or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8') or (ansible_os_family in ['Oracle Linux', 'RedHat'] and ansible_distribution_major_version >= '7') -%}
8991
{% if ssh_client_weak_kex -%}
9092
KexAlgorithms {{ ssh_kex_66_weak | join(',') }}
9193
{% else -%}
9294
KexAlgorithms {{ ssh_kex_66_default | join(',') }}
9395
{% endif %}
9496
{% else -%}
95-
{% if ansible_os_family in ['Oracle Linux', 'RedHat'] -%}
97+
{% if ansible_os_family in ['Oracle Linux', 'RedHat'] and ansible_distribution_major_version <= '6' -%}
9698
#KexAlgorithms
9799
{% elif ssh_client_weak_kex -%}
98100
KexAlgorithms {{ ssh_kex_59_weak | join(',') }}

templates/opensshd.conf.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ LogLevel VERBOSE
8080
MACs {{ ssh_macs_66_default | join(',') }}
8181
{% elif ansible_os_family in ['Oracle Linux', 'RedHat'] and ansible_distribution_major_version <= '6' -%}
8282
MACs {{ ssh_macs_53_default | join(',') }}
83+
{% else -%}
84+
MACs {{ ssh_macs_59_default | join(',') }}
8385
{% endif %}
8486
{% endif %}
8587

0 commit comments

Comments
 (0)