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:
parent
0b2d1f339f
commit
d03df1994d
3 changed files with 7 additions and 1 deletions
|
@ -24,6 +24,7 @@ users:
|
||||||
- ottojo@uni
|
- ottojo@uni
|
||||||
- ottojo@home
|
- ottojo@home
|
||||||
```
|
```
|
||||||
|
*have a look into defaults/main.yml foraditionally informations!*
|
||||||
|
|
||||||
Files
|
Files
|
||||||
-----
|
-----
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
---
|
---
|
||||||
|
# default users for SSH access
|
||||||
|
sshd_default_allowed_users:
|
||||||
|
- "root"
|
||||||
|
- "ansible"
|
||||||
|
|
||||||
# Enable AllowUsers and AllowGroups options
|
# Enable AllowUsers and AllowGroups options
|
||||||
restrict_allow_users: True
|
restrict_allow_users: True
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
- name: Collect all users and groups allowed to login via ssh
|
- name: Collect all users and groups allowed to login via ssh
|
||||||
set_fact:
|
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 }}'
|
sshd_allow_groups: '{{ ["root", "admins"] + users.keys() | default({}) | sort }}'
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue