|
|
|
@ -9,6 +9,7 @@
|
|
|
|
|
- "{{ evobsd_ssh_group }}"
|
|
|
|
|
- "{{ evobsd_sudo_group }}"
|
|
|
|
|
tags:
|
|
|
|
|
- accounts
|
|
|
|
|
- admin
|
|
|
|
|
|
|
|
|
|
- name: "Create user accounts"
|
|
|
|
@ -18,6 +19,7 @@
|
|
|
|
|
with_dict: "{{ evolix_users }}"
|
|
|
|
|
when: evolix_users != {}
|
|
|
|
|
tags:
|
|
|
|
|
- accounts
|
|
|
|
|
- admin
|
|
|
|
|
|
|
|
|
|
- name: "Verify AllowGroups directive"
|
|
|
|
@ -27,6 +29,7 @@
|
|
|
|
|
check_mode: false
|
|
|
|
|
register: grep_allowgroups_ssh
|
|
|
|
|
tags:
|
|
|
|
|
- accounts
|
|
|
|
|
- admin
|
|
|
|
|
|
|
|
|
|
- name: "Verify AllowUsers directive"
|
|
|
|
@ -36,6 +39,7 @@
|
|
|
|
|
check_mode: false
|
|
|
|
|
register: grep_allowusers_ssh
|
|
|
|
|
tags:
|
|
|
|
|
- accounts
|
|
|
|
|
- admin
|
|
|
|
|
|
|
|
|
|
- name: "Check that AllowUsers and AllowGroup do not override each other"
|
|
|
|
@ -43,6 +47,7 @@
|
|
|
|
|
that: "not (grep_allowusers_ssh.rc == 0 and grep_allowgroups_ssh.rc == 0)"
|
|
|
|
|
msg: "We can't deal with AllowUsers and AllowGroups at the same time"
|
|
|
|
|
tags:
|
|
|
|
|
- accounts
|
|
|
|
|
- admin
|
|
|
|
|
|
|
|
|
|
- name: "If AllowGroups is present then use it"
|
|
|
|
@ -50,6 +55,7 @@
|
|
|
|
|
ssh_allowgroups:
|
|
|
|
|
"{{ (grep_allowgroups_ssh.rc == 0) or (grep_allowusers_ssh.rc != 0) }}"
|
|
|
|
|
tags:
|
|
|
|
|
- accounts
|
|
|
|
|
- admin
|
|
|
|
|
|
|
|
|
|
- name: "Add AllowGroups sshd directive with '{{ evobsd_ssh_group }}'"
|
|
|
|
@ -63,6 +69,7 @@
|
|
|
|
|
- ssh_allowgroups
|
|
|
|
|
- grep_allowgroups_ssh.rc == 1
|
|
|
|
|
tags:
|
|
|
|
|
- accounts
|
|
|
|
|
- admin
|
|
|
|
|
|
|
|
|
|
- name: "Append '{{ evobsd_ssh_group }}' to AllowGroups sshd directive"
|
|
|
|
@ -76,6 +83,7 @@
|
|
|
|
|
- ssh_allowgroups
|
|
|
|
|
- grep_allowgroups_ssh.rc == 0
|
|
|
|
|
tags:
|
|
|
|
|
- accounts
|
|
|
|
|
- admin
|
|
|
|
|
|
|
|
|
|
- name: "Security directives for EvoBSD"
|
|
|
|
@ -93,6 +101,7 @@
|
|
|
|
|
when:
|
|
|
|
|
- evolix_trusted_ips != []
|
|
|
|
|
tags:
|
|
|
|
|
- accounts
|
|
|
|
|
- admin
|
|
|
|
|
|
|
|
|
|
- name: "Disable root login"
|
|
|
|
@ -102,4 +111,5 @@
|
|
|
|
|
replace: "PermitRootLogin no"
|
|
|
|
|
notify: reload sshd
|
|
|
|
|
tags:
|
|
|
|
|
- accounts
|
|
|
|
|
- admin
|
|
|
|
|