forked from evolix/ansible-roles
Jérémy Lecour
2ed77c60f0
replace « x | changed » by « x is changed » add explicit « bool » filter use « length » filter instead of string comparison
84 lines
1.6 KiB
YAML
84 lines
1.6 KiB
YAML
---
|
|
- name: package is installed
|
|
apt:
|
|
name: proftpd-basic
|
|
state: present
|
|
tags:
|
|
- proftpd
|
|
- packages
|
|
|
|
- name: ftpusers groupe exists
|
|
group:
|
|
name: ftpusers
|
|
state: present
|
|
notify: restart proftpd
|
|
tags:
|
|
- proftpd
|
|
|
|
- name: FTP jail is installed
|
|
template:
|
|
src: evolinux.conf.j2
|
|
dest: /etc/proftpd/conf.d/z-evolinux.conf
|
|
mode: "0644"
|
|
force: no
|
|
notify: restart proftpd
|
|
when: proftpd_ftp_enable | bool
|
|
tags:
|
|
- proftpd
|
|
|
|
- name: FTPS jail is installed
|
|
template:
|
|
src: ftps.conf.j2
|
|
dest: /etc/proftpd/conf.d/ftps.conf
|
|
mode: "0644"
|
|
force: no
|
|
notify: restart proftpd
|
|
when: proftpd_ftps_enable | bool
|
|
tags:
|
|
- proftpd
|
|
|
|
- name: SFTP jail is installed
|
|
template:
|
|
src: sftp.conf.j2
|
|
dest: /etc/proftpd/conf.d/sftp.conf
|
|
mode: "0644"
|
|
force: no
|
|
notify: restart proftpd
|
|
when: proftpd_sftp_enable | 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:
|
|
- proftpd
|
|
|
|
- name: Put empty vpasswd file if missing
|
|
copy:
|
|
src: vpasswd
|
|
dest: /etc/proftpd/vpasswd
|
|
force: no
|
|
notify: restart proftpd
|
|
tags:
|
|
- 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
|
|
mode: "0440"
|
|
owner: root
|
|
group: root
|
|
notify: restart proftpd
|
|
tags:
|
|
- proftpd
|
|
|
|
- include: accounts.yml
|
|
when: proftpd_accounts | length > 0
|