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
|
List of groups for the `AllowGroups` keyword
|
||||||
|
|
||||||
|
|
||||||
|
Files
|
||||||
|
-----
|
||||||
|
|
||||||
|
* `sshd.conf`:
|
||||||
|
|
||||||
|
|
||||||
References
|
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
|
- name: Copy sshd configuration
|
||||||
template:
|
template:
|
||||||
src: sshd_config
|
src: sshd_config
|
||||||
|
|
Loading…
Reference in a new issue