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

Commit 7685b8f

Browse files
neophy7eBentoumiTech
authored andcommitted
Use ansible version compare module
Signed-off-by: neophy7e <kbentoumi@gmail.com> Signed-off-by: neophy7e <> Signed-off-by: neophy7e <kbentoumi@gmail.com>
1 parent 1578927 commit 7685b8f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

templates/openssh.conf.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ ForwardX11 no
8282

8383
# Never use host-based authentication. It can be exploited.
8484
HostbasedAuthentication no
85-
{% if sshd_version.stdout | float < 7.4 -%}
85+
{% if sshd_version.stdout is version('7.4', '<=') %}
8686
RhostsRSAAuthentication no
8787
# Enable RSA authentication via identity files.
8888
RSAAuthentication yes
@@ -111,7 +111,7 @@ Compression yes
111111
#EscapeChar ~
112112
#VisualHostKey yes
113113

114-
{% if sshd_version.stdout | float <= 7.1 -%}
114+
{% if sshd_version.stdout is version('7.1', '<=') %}
115115
# Disable experimental client roaming. This is known to cause potential issues with secrets being disclosed to malicious servers and defaults to being disabled.
116116
UseRoaming {{ 'yes' if ssh_client_roaming else 'no' }}
117117
{% endif %}

templates/opensshd.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ LogLevel VERBOSE
7575
# --------------
7676

7777
# Secure Login directives.
78-
{% if sshd_version.stdout | float < 7.5 -%}
78+
{% if sshd_version.stdout is version('7.5', '<') %}
7979
UsePrivilegeSeparation {% if (ansible_distribution == 'Debian' and ansible_distribution_major_version <= '6') or (ansible_os_family in ['Oracle Linux', 'RedHat'] and ansible_distribution_major_version <= '6') -%}{{ssh_ps53}}{% else %}{{ssh_ps59}}{% endif %}
8080
{% endif %}
8181

0 commit comments

Comments
 (0)