ansible-roles/proftpd/tasks/main.yml

98 lines
2 KiB
YAML
Raw Normal View History

---
- name: package is installed
apt:
name: proftpd-basic
state: present
tags:
2017-12-04 13:50:21 +01:00
- proftpd
- packages
- name: ftpusers groupe exists
group:
name: ftpusers
state: present
notify: restart proftpd
tags:
2017-12-04 13:50:21 +01:00
- proftpd
2019-01-24 11:47:03 +01:00
- name: FTP jail is installed
template:
src: evolinux.conf.j2
dest: /etc/proftpd/conf.d/z-evolinux.conf
mode: "0644"
force: "{{ proftpd_ftp_override }}"
notify: restart proftpd
when: proftpd_ftp_enable | bool
2019-01-24 11:47:03 +01:00
tags:
- proftpd
- name: FTPS jail is installed
template:
src: ftps.conf.j2
dest: /etc/proftpd/conf.d/ftps.conf
mode: "0644"
force: "{{ proftpd_ftps_override }}"
2019-01-24 11:47:03 +01:00
notify: restart proftpd
when: proftpd_ftps_enable | bool
2019-01-24 11:47:03 +01:00
tags:
- proftpd
- name: SFTP jail is installed
template:
src: sftp.conf.j2
dest: /etc/proftpd/conf.d/sftp.conf
mode: "0644"
force: "{{ proftpd_sftp_override }}"
2019-01-24 11:47:03 +01:00
notify: restart proftpd
when: proftpd_sftp_enable | bool
tags:
2017-12-04 13:50:21 +01:00
- proftpd
2022-09-13 16:29:59 +02:00
- name: SFTP key folder exists if needed
file:
path: /etc/proftpd/sftp.authorized_keys/
state: directory
mode: "0755"
2022-09-13 16:29:59 +02:00
owner: root
group: root
notify: restart proftpd
when:
- proftpd_sftp_enable | bool
- proftpd_sftp_use_publickeys | bool
tags:
- proftpd
- name: mod_tls_memcache is disabled
replace:
dest: /etc/proftpd/modules.conf
regexp: '^LoadModule mod_tls_memcache.c'
replace: '#LoadModule mod_tls_memcache.c'
notify: restart proftpd
tags:
2017-12-04 13:50:21 +01:00
- proftpd
2017-10-05 18:46:40 +02:00
- name: Put empty vpasswd file if missing
copy:
src: vpasswd
dest: /etc/proftpd/vpasswd
force: no
notify: restart proftpd
tags:
2017-12-04 13:50:21 +01:00
- proftpd
# Why 440? Because should be edited with ftpasswd.
# So, readonly when opened with vim.
# Then readable by group.
- name: Enforce permissions on password file
file:
path: /etc/proftpd/vpasswd
2017-10-05 18:46:40 +02:00
mode: "0440"
owner: root
group: root
notify: restart proftpd
2017-10-05 18:46:40 +02:00
tags:
2017-12-04 13:50:21 +01:00
- proftpd
- include: accounts.yml
when: proftpd_accounts | length > 0