From 0df06810fcc4897bc6335ceb6425363a9cf1ec68 Mon Sep 17 00:00:00 2001 From: nd Date: Tue, 25 Jun 2019 20:12:28 +0100 Subject: [PATCH] added support for multiple user overrides --- defaults/main.yml | 2 +- templates/ssh_sshd_config.j2 | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 0c64578..9854bb5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,7 +1,7 @@ --- -sshuser: {} rootpath: '' ssh: config_override: AuthorizedKeysFile: ".ssh/authorized_keys" + user: {} diff --git a/templates/ssh_sshd_config.j2 b/templates/ssh_sshd_config.j2 index da5f97b..ae16b3a 100644 --- a/templates/ssh_sshd_config.j2 +++ b/templates/ssh_sshd_config.j2 @@ -57,9 +57,9 @@ MaxAuthTries 10 # add special rules for users defined in host variables -{% for i in sshuser %} +{% for i in ssh.user %} Match User {{ i }} - {% for j in sshuser[i]|d({}) %} - {{ j }} {{ sshuser[i][j] }} + {% for j in ssh.user[i]|d({}) %} + {{ j }} {{ ssh.user[i][j] }} {% endfor %} {% endfor %}