robgmills.pure-ftpd
Ansible Role: Pure-FTPd
This role installs Pure-FTPd on Debian/Ubuntu Linux.
It installs and sets up the latest version of Pure-FTPd using apt (on Debian-based systems). After installing Pure-FTPd, you might need to perform some additional setup.
Requirements
None.
Role Variables
Here are the available variables with their default values (see defaults/main.yml
):
pure_ftpd_root: "/var/ftp"
This is the directory where the FTP server will allow access.
pure_ftpd_user: "ftp"
This is the system user that runs the FTP service. This user cannot log in but has ownership of files uploaded via FTP.
pure_ftpd_group: "ftp-sys-group"
This is the system group used by the FTP service. It is assigned to all files uploaded via FTP.
pure_ftpd_vusers:
- name: "ftp" password: "FTPisSoC00l?" dir: "/var/ftp" # optional
This is a list of virtual FTP users. If left empty, it will create a default user with username
ftp
and passwordftp
. You must providename
andpassword
, whiledir
is optional and defaults toftp_root
.It's recommended to use an Ansible Vault-encrypted variable file to keep these credentials secure.
pure_ftpd_tls: true
This enables FTP TLS encryption support. It's highly recommended to keep this set to
true
.pure_ftpd_allow_insecure: false
When TLS is on, this will not allow unencrypted connections by default. Setting this to
true
allows both secure and insecure connections, but requiresenable_tls
to betrue
.pure_ftpd_pem: ""
This is where you put the PEM certificate for FTP TLS encryption. It's best to keep this in an Ansible Vault-encrypted variable file.
If you don't provide
pure_ftpd_pem
, a PEM certificate will be generated usingopenssl
.pure_ftpd_openssl_config: {}
This object controls how to generate an openssl PEM certificate and key.
The openssl_config
sub-properties include:
days: "365"
This defines how long the certificate is valid.
size: "2048"
This specifies the certificate key size, with larger sizes being more secure.
country, state, locality, org, unit, common, email:
These are the details for the certificate subject.
Dependencies
None.
Example Playbook
- hosts: server
roles:
- role: robgmills.pure-ftpd
Try It!
From the project root, run:
vagrant up
Then execute:
ansible-playbook -i inventory -b -u vagrant -k playbook.yml
After that, connect to ftps://ftp:[email protected]
using your favorite FTPS client.
License
MIT / BSD
Author Information
This role was created in 2016 by Rob Mills.
Installs and configures a Pure-FTPd server
ansible-galaxy install robgmills.pure-ftpd