From d8dd18c3b486be17f97a454f171fa63f63ffc0f2 Mon Sep 17 00:00:00 2001 From: Jonathan Piron Date: Wed, 11 Oct 2017 12:17:50 +0200 Subject: [PATCH] Allow multiple match blocks By adding the sftp_group_name in the block marker, one can execute the role several times with different groups without overriding existing configuration. For instance, this can be used to defined 2 stfp groups, one allowing password authentication and not the other. --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 12ed025..21f58f9 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -33,7 +33,7 @@ - name: SFTP-Server | Add sshd_config block blockinfile: dest: /etc/ssh/sshd_config - marker: '# {mark} SFTP-Server block' + marker: '# {mark} SFTP-Server {{ sftp_group_name }} block' block: | Match Group {{ sftp_group_name }} ChrootDirectory %h