2016-11-07 14:00:57 +01:00
|
|
|
---
|
|
|
|
- name: package is installed
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.apt:
|
2016-11-07 14:00:57 +01:00
|
|
|
name: proftpd-basic
|
2017-01-12 17:37:48 +01:00
|
|
|
state: present
|
2016-11-07 14:00:57 +01:00
|
|
|
tags:
|
2017-12-04 13:50:21 +01:00
|
|
|
- proftpd
|
|
|
|
- packages
|
2016-11-07 14:00:57 +01:00
|
|
|
|
|
|
|
- name: ftpusers groupe exists
|
2023-03-20 23:33:19 +01:00
|
|
|
|
|
|
|
ansible.builtin.group:
|
2016-11-07 14:00:57 +01:00
|
|
|
name: ftpusers
|
|
|
|
state: present
|
|
|
|
notify: restart proftpd
|
|
|
|
tags:
|
2017-12-04 13:50:21 +01:00
|
|
|
- proftpd
|
2016-11-07 14:00:57 +01:00
|
|
|
|
2019-01-24 11:47:03 +01:00
|
|
|
- name: FTP jail is installed
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.template:
|
2016-11-07 14:00:57 +01:00
|
|
|
src: evolinux.conf.j2
|
|
|
|
dest: /etc/proftpd/conf.d/z-evolinux.conf
|
2017-03-23 16:59:43 +01:00
|
|
|
mode: "0644"
|
2022-09-13 16:26:10 +02:00
|
|
|
force: "{{ proftpd_ftp_override }}"
|
2016-11-07 14:00:57 +01:00
|
|
|
notify: restart proftpd
|
2021-05-09 23:06:42 +02:00
|
|
|
when: proftpd_ftp_enable | bool
|
2019-01-24 11:47:03 +01:00
|
|
|
tags:
|
|
|
|
- proftpd
|
|
|
|
|
|
|
|
- name: FTPS jail is installed
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.template:
|
2019-01-24 11:47:03 +01:00
|
|
|
src: ftps.conf.j2
|
|
|
|
dest: /etc/proftpd/conf.d/ftps.conf
|
|
|
|
mode: "0644"
|
2022-09-13 16:26:10 +02:00
|
|
|
force: "{{ proftpd_ftps_override }}"
|
2019-01-24 11:47:03 +01:00
|
|
|
notify: restart proftpd
|
2021-05-09 23:06:42 +02:00
|
|
|
when: proftpd_ftps_enable | bool
|
2019-01-24 11:47:03 +01:00
|
|
|
tags:
|
|
|
|
- proftpd
|
|
|
|
|
|
|
|
- name: SFTP jail is installed
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.template:
|
2019-01-24 11:47:03 +01:00
|
|
|
src: sftp.conf.j2
|
|
|
|
dest: /etc/proftpd/conf.d/sftp.conf
|
|
|
|
mode: "0644"
|
2022-09-13 16:26:10 +02:00
|
|
|
force: "{{ proftpd_sftp_override }}"
|
2019-01-24 11:47:03 +01:00
|
|
|
notify: restart proftpd
|
2021-05-09 23:06:42 +02:00
|
|
|
when: proftpd_sftp_enable | bool
|
2016-11-07 14:00:57 +01:00
|
|
|
tags:
|
2017-12-04 13:50:21 +01:00
|
|
|
- proftpd
|
2016-11-07 14:00:57 +01:00
|
|
|
|
2022-09-13 16:29:59 +02:00
|
|
|
- name: SFTP key folder exists if needed
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.file:
|
2022-09-13 16:29:59 +02:00
|
|
|
path: /etc/proftpd/sftp.authorized_keys/
|
|
|
|
state: directory
|
2022-12-09 10:19:51 +01:00
|
|
|
mode: "0755"
|
2022-09-13 16:29:59 +02:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
notify: restart proftpd
|
2023-01-06 09:54:51 +01:00
|
|
|
when:
|
2022-09-13 16:29:59 +02:00
|
|
|
- proftpd_sftp_enable | bool
|
|
|
|
- proftpd_sftp_use_publickeys | bool
|
|
|
|
tags:
|
|
|
|
- proftpd
|
|
|
|
|
2016-11-07 14:00:57 +01:00
|
|
|
- name: mod_tls_memcache is disabled
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.replace:
|
2016-11-07 14:00:57 +01:00
|
|
|
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
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.copy:
|
2017-10-05 18:46:40 +02:00
|
|
|
src: vpasswd
|
|
|
|
dest: /etc/proftpd/vpasswd
|
2023-06-28 13:22:59 +02:00
|
|
|
force: false
|
2017-10-07 21:43:05 +02:00
|
|
|
notify: restart proftpd
|
|
|
|
tags:
|
2017-12-04 13:50:21 +01:00
|
|
|
- proftpd
|
2017-10-07 21:43:05 +02:00
|
|
|
|
|
|
|
# Why 440? Because should be edited with ftpasswd.
|
|
|
|
# So, readonly when opened with vim.
|
|
|
|
# Then readable by group.
|
|
|
|
- name: Enforce permissions on password file
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.file:
|
2017-10-07 21:43:05 +02:00
|
|
|
path: /etc/proftpd/vpasswd
|
2017-10-05 18:46:40 +02:00
|
|
|
mode: "0440"
|
2017-10-07 21:43:05 +02:00
|
|
|
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
|
2018-02-27 17:10:25 +01:00
|
|
|
|
2023-03-20 23:33:19 +01:00
|
|
|
- ansible.builtin.include: accounts.yml
|
2021-05-09 23:06:42 +02:00
|
|
|
when: proftpd_accounts | length > 0
|