From 3a3cda6c507536e28925935286dde4c17bd12c90 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Mon, 19 Sep 2022 14:44:20 +0200 Subject: [PATCH] limit distributions major version check to redhat --- templates/etc/ssh/sshd_config.j2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/etc/ssh/sshd_config.j2 b/templates/etc/ssh/sshd_config.j2 index 842946a..3a8333b 100644 --- a/templates/etc/ssh/sshd_config.j2 +++ b/templates/etc/ssh/sshd_config.j2 @@ -19,7 +19,7 @@ #AddressFamily any #ListenAddress 0.0.0.0 #ListenAddress :: -{% if ansible_distribution_major_version is version('8', '<') %} +{% if ansible_os_family | lower == "redhat" and ansible_distribution_major_version is version('8', '<') %} Protocol {{ sshd_protocol }} {% endif %} @@ -121,13 +121,13 @@ X11Forwarding {{ sshd_x11_forwarding }} #X11DisplayOffset 10 #X11UseLocalhost yes #PermitTTY yes -{% if ansible_distribution_major_version is version('7', '>') %} +{% if ansible_os_family | lower == "redhat" and ansible_distribution_major_version is version('7', '>') %} PrintMotd no {% endif %} #PrintLastLog no TCPKeepAlive {{ sshd_tcp_keep_alive }} #UseLogin no -{% if ansible_distribution_major_version is version('8', '<') %} +{% if ansible_os_family | lower == "redhat" and ansible_distribution_major_version is version('8', '<') %} UsePrivilegeSeparation sandbox {% endif %} #PermitUserEnvironment no