mirror of
https://github.com/roles-ansible/ansible_role_sshd.git
synced 2024-08-16 11:59:49 +02:00
Add ssh group variable
This commit is contained in:
parent
d03df1994d
commit
2e1db1e216
2 changed files with 7 additions and 3 deletions
|
@ -4,5 +4,11 @@ sshd_default_allowed_users:
|
||||||
- "root"
|
- "root"
|
||||||
- "ansible"
|
- "ansible"
|
||||||
|
|
||||||
|
# don't forget to add the ssh_access group!
|
||||||
|
sshd_default_allowed_groups:
|
||||||
|
- "root"
|
||||||
|
- "admins"
|
||||||
|
|
||||||
|
|
||||||
# Enable AllowUsers and AllowGroups options
|
# Enable AllowUsers and AllowGroups options
|
||||||
restrict_allow_users: True
|
restrict_allow_users: True
|
||||||
|
|
|
@ -12,12 +12,10 @@
|
||||||
- ansible_distribution == 'Fedora'
|
- ansible_distribution == 'Fedora'
|
||||||
- ansible_distribution == 'Archlinux'
|
- ansible_distribution == 'Archlinux'
|
||||||
|
|
||||||
|
|
||||||
- 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: '{{ sshd_default_allowed_users + 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: '{{ sshd_default_allowed_groups + users.keys() | default({}) | sort }}'
|
||||||
|
|
||||||
|
|
||||||
- name: Copy sshd configuration
|
- name: Copy sshd configuration
|
||||||
become: yes
|
become: yes
|
||||||
|
|
Loading…
Reference in a new issue