1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_sshd.git synced 2024-08-16 11:59:49 +02:00

Automatically compose allowed users and groups lists

This commit is contained in:
Raoul 2018-03-16 04:54:02 +01:00
parent 223f92ed1a
commit 6199a6b067
No known key found for this signature in database
GPG key ID: C7493D73B67C1842
2 changed files with 12 additions and 0 deletions

View file

@ -14,6 +14,12 @@ Variables
List of groups for the `AllowGroups` keyword List of groups for the `AllowGroups` keyword
Files
-----
* `sshd.conf`:
References References
---------- ----------

View file

@ -1,4 +1,10 @@
--- ---
- name: Collect all users and groups allowed to login via ssh
set_fact:
sshd_allow_users: '{{ ["root"] + users.keys() | default({}) | sort }}'
sshd_allow_groups: '{{ ["root"] + users.keys() | default({}) | sort }}'
- name: Copy sshd configuration - name: Copy sshd configuration
template: template:
src: sshd_config src: sshd_config