Skip to content

Commit

Permalink
Allow multiple match blocks
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Jonathan Piron committed Oct 11, 2017
1 parent 014f569 commit d8dd18c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d8dd18c

Please sign in to comment.