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