Feat: add ftp

This commit is contained in:
Bertrand Benjamin 2022-09-06 20:19:43 +02:00
parent b365759be6
commit c6eab7b09a
3 changed files with 36 additions and 0 deletions

11
files/vsftpd.conf.j2 Normal file
View File

@ -0,0 +1,11 @@
listen=YES
listen_ipv6=NO
anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
allow_writeable_chroot=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd

View File

@ -14,6 +14,7 @@
tasks: tasks:
- include: tasks/lamp.yml - include: tasks/lamp.yml
- include: tasks/ftp.yml
- include: tasks/accounts.yml - include: tasks/accounts.yml
handlers: handlers:
@ -26,3 +27,8 @@
service: service:
name: apache2 name: apache2
state: restarted state: restarted
- name: Reload vsftpd
service:
name: vsftpd
state: reload

19
tasks/ftp.yml Normal file
View File

@ -0,0 +1,19 @@
---
- name: Install vsftpd Packages
apt:
name: "{{ item }}"
state: latest
loop:
- 'vsftpd'
- name: Set up vsftpd conf
template:
src: "files/vsftpd.conf.j2"
dest: "/etc/vsftpd.conf"
notify: Reload vsftpd
- name: Start vsftpd service
service:
name: vsftpd
enabled: true
state: started