This commit is contained in:
2020-05-30 20:04:30 +02:00
parent bacd87430a
commit e2a215b393
9 changed files with 222 additions and 5 deletions

View File

@ -20,7 +20,7 @@
owner: root
group: root
mode: 0644
validate: 'sshd -f %s -T'
validate: 'sshd -f %s -T -C user=sftp_users'
#backup: yes
notify: "Restart ssh"
tags:

View File

@ -95,6 +95,38 @@
tags:
- authorized_key
# ---
# - extra system user
# ---
- name: (users.yml) extra system user exists?
user:
name: '{{ item.name }}'
state: present
system: yes
home: '{{ item.home }}'
shell: '{{ item.shell|d("/usr/sbin/nologin") }}'
loop: "{{ extra_system_user }}"
loop_control:
label: '{{ item.name }}'
when: extra_system_user is defined and extra_system_user|length > 0
tags:
- user-exists
# ---
# - extra system groups
# ---
- name: (users.yml) Extra system group sftp_users
group:
name: 'sftp_users'
state: present
system: yes
when:
- create_sftp_group is defined and create_sftp_group > 0
tags:
- groups-exists
# ---
# - Take care backup host has rsa key to connect via ssh to the other hosts