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:
parent
223f92ed1a
commit
6199a6b067
2 changed files with 12 additions and 0 deletions
|
@ -14,6 +14,12 @@ Variables
|
|||
List of groups for the `AllowGroups` keyword
|
||||
|
||||
|
||||
Files
|
||||
-----
|
||||
|
||||
* `sshd.conf`:
|
||||
|
||||
|
||||
References
|
||||
----------
|
||||
|
||||
|
|
|
@ -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
|
||||
template:
|
||||
src: sshd_config
|
||||
|
|
Loading…
Reference in a new issue