From 07b4bee34f5ec2a5029d8f0113d0455e4bd854c9 Mon Sep 17 00:00:00 2001 From: nd Date: Tue, 18 Jun 2019 00:14:38 +0100 Subject: [PATCH] added support for ssh option override --- defaults/main.yml | 4 ++++ templates/ssh_sshd_config.j2 | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index bb442d9..0c64578 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,3 +1,7 @@ --- sshuser: {} rootpath: '' + +ssh: + config_override: + AuthorizedKeysFile: ".ssh/authorized_keys" diff --git a/templates/ssh_sshd_config.j2 b/templates/ssh_sshd_config.j2 index 323bf6e..bcf1654 100644 --- a/templates/ssh_sshd_config.j2 +++ b/templates/ssh_sshd_config.j2 @@ -49,10 +49,12 @@ Subsystem sftp internal-sftp UsePam yes # needed to create home dirs with an ldap login -AuthorizedKeysFile /root/.ssh/authorized_keys - MaxAuthTries 10 +{% for i in ssh.config_override|d({}) %} +{{ i }} {{ ssh.config_override[i] }} +{% endfor %} + # add special rules for users defined in host variables {% for i in sshuser %}