sftpuser: Remove unused role

This commit is contained in:
Timo Makinen 2024-06-22 19:32:50 +00:00
parent c9e8ec6d7c
commit de94e75549
3 changed files with 0 additions and 40 deletions

View file

@ -1,2 +0,0 @@
---
sftpuser_chroot: /srv/backup

View file

@ -1,3 +0,0 @@
---
dependencies:
- {role: sshd}

View file

@ -1,35 +0,0 @@
---
- name: Create group
ansible.builtin.group:
name: backup
system: true
- name: Create user
ansible.builtin.user:
name: backup
comment: Service backup
createhome: false
group: backup
home: /var/empty
shell: /sbin/nologin
system: true
- name: Create authorized_keys
ansible.builtin.copy:
dest: /etc/ssh/authorized_keys.backup
src: ../files/ssh/backup.pub
mode: "0640"
owner: root
group: backup
- name: Configure sshd chroot
ansible.builtin.blockinfile:
path: /etc/ssh/sshd_config
block: |
Match User backup
ChrootDirectory {{ sftpuser_chroot }}
ForceCommand internal-sftp
AuthorizedKeysFile /etc/ssh/authorized_keys.backup
marker: "# {mark} ANSIBLE MANAGED BLOCK (user backup)"
validate: "sshd -t -f %s"
notify: Restart sshd