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

allow dynamic user configuration

This commit is contained in:
Lilian Roller 2019-03-27 14:23:41 +01:00
parent 0b2d1f339f
commit d03df1994d
No known key found for this signature in database
GPG key ID: 5215C3441797AB2B
3 changed files with 7 additions and 1 deletions

View file

@ -24,6 +24,7 @@ users:
- ottojo@uni
- ottojo@home
```
*have a look into defaults/main.yml foraditionally informations!*
Files
-----

View file

@ -1,3 +1,8 @@
---
# default users for SSH access
sshd_default_allowed_users:
- "root"
- "ansible"
# Enable AllowUsers and AllowGroups options
restrict_allow_users: True

View file

@ -15,7 +15,7 @@
- name: Collect all users and groups allowed to login via ssh
set_fact:
sshd_allow_users: '{{ ["root", "ansible"] + users.keys() | default({}) | sort }}'
sshd_allow_users: '{{ sshd_default_allowed_users + users.keys() | default({}) | sort }}'
sshd_allow_groups: '{{ ["root", "admins"] + users.keys() | default({}) | sort }}'