From 132e65699242dd4194ac3ad9fd43888f7080b765 Mon Sep 17 00:00:00 2001 From: L3D Date: Tue, 4 Aug 2020 15:49:36 +0200 Subject: [PATCH] use ternary('yes', 'no') --- templates/sshd_config.j2 | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/templates/sshd_config.j2 b/templates/sshd_config.j2 index b67aea6..6437e5b 100644 --- a/templates/sshd_config.j2 +++ b/templates/sshd_config.j2 @@ -63,23 +63,13 @@ HostKey /etc/ssh/ssh_host_{{ key }}_key # Client authentication MaxAuthTries 6 MaxSessions 10 -PasswordAuthentication -{%- if sshd__password_authentication | bool -%} - {{ ' yes' }} -{% else -%} - {{ ' no' }} -{% endif %} +PasswordAuthentication {{ sshd__password_authentication | ternary('yes', 'no') }} ChallengeResponseAuthentication no PubkeyAuthentication yes PermitRootLogin without-password LoginGraceTime 120 StrictModes yes -X11Forwarding -{%- if sshd__xforwarding | bool -%} - {{ ' yes' }} -{% else -%} - {{ ' no' }} -{% endif %} +X11Forwarding {{ sshd__xforwarding | ternary('yes', 'no') }} AllowTcpForwarding yes #GatewayPorts no