manala.proftpd

#######################################################################################################

:exclamation: DEPRECATION :exclamation:

This repository and its associated role are no longer maintained. Please use the Manala Ansible Collection instead.

For information on how to use it, please visit the collection repository.

#######################################################################################################

Ansible Role: ProFTPd Build Status

:exclamation: Please report any issues and submit Pull Requests to the main Ansible Role repository :exclamation:

This role helps you set up ProFTPd.

It’s part of the Manala Ansible stack but can also be used independently.

Requirements

None.

Dependencies

None.

Installation

Ansible 2+

You can install using ansible galaxy CLI:

ansible-galaxy install manala.proftpd

Or you can add it to an ansible galaxy requirements file:

- src: manala.proftpd

Role Handlers

Name Type Description
proftpd restart Service Restart the ProFTPd server

Role Variables

Name Default Type Description
manala_proftpd_install_packages ~ Array Packages to install
manala_proftpd_install_packages_default ['proftpd-basic'] Array Default packages to install
manala_proftpd_configs_exclusive false Boolean Exclusive configuration
manala_proftpd_configs_dir '/etc/proftpd/conf.d' String Directory for configurations
manala_proftpd_configs_defaults {} String Default configuration values
manala_proftpd_configs [] Array Configurations
manala_proftpd_users_file '/etc/ftpd.passwd' String File for user accounts
manala_proftpd_users_template 'users/_default.j2' String Template for user accounts
manala_proftpd_users_defaults {...} Array Default user account values
manala_proftpd_users [] Array User accounts for ProFTPd

Configuration example

Use manala_proftpd_configs to define configurations based on chosen templates.

Set manala_proftpd_configs_exclusive to clean up existing ProFTPd configuration files in the directory set by manala_proftpd_configs_dir. This ensures that no old files will affect the current configuration.

manala_proftpd_configs_exclusive: true

You can specify a state (present|absent).

manala_proftpd_configs:
  # Key-value based
  - file: default.conf
    config:
      ServerName: Manala
      PassivePorts: 10000 10030
      DefaultRoot: "~"
      AuthOrder: mod_auth_file.c
      AuthUserFile: /etc/ftpd.passwd
      RequireValidShell: false
  # Content based
  - file: content.conf
    config: |
      <Anonymous ~ftp>
        User  ftp
        Group nogroup
      </Anonymous>
  # Template based
  - file: template.conf
    template: my_proftpd_template.conf.j2
    config:
      Foo: bar
  # To ensure config is absent
  - file: absent.conf
    state: absent # "present" by default
  # Ignore config
  - file: ignore.conf
    state: ignore
  # Flatten configurations
  - "{{ my_custom_configs_array }}"

VirtualHost

You can configure a VirtualHost as well:

  - file: virtual_host_foo.conf
    config:
      - VirtualHost ftp.foo.com:
        - ServerName: Foo FTP Server
        - MaxClients: 10
        - MaxLoginAttempts: 1
        - Limit LOGIN:
          - Order: Allow,Deny
          - AllowUser: foo
          - Deny: from all
        - DefaultRoot: "~"
        - Directory /srv/ftp/docs:
          - Limit ALL:
            - DenyAll

User account configuration

Use manala_proftpd_users_template to define which users can access FTP storage.

manala_proftpd_users_defaults:
  uid: 1337 # Will apply to all users
  gid: 7331

manala_proftpd_users:
  - name: manala
    password: "$1$KBijsXOEr4"b$9HEyZDLPnSe3SXq0n66oE3y/"
    home: /srv/my_dir
    shell: /bin/false
  - name: toto
    password: "$1$9f19dba0ce5ece883b53275dcc1721b9"
    home: /home/toto
    shell: /bin/false
    mode: "0755"
    uid: 1000
    gid: 1000

We strongly recommend generating SHA2 password hashes. On Linux, you can generate one with: echo -n yourpassword | mkpasswd --method=sha-512 -

Example playbook

- hosts: servers
  roles:
    - role: manala.proftpd

License

MIT

Author information

Manala (http://www.manala.io/) is an open-source project supported by the French web agency (ELAO).

Informazioni sul progetto

Handle proftpd

Installa
ansible-galaxy install manala.proftpd
Licenza
Unknown
Download
8.1k
Proprietario
Manala is an open source project supported by the french web agency ELAO providing advanced ansible roles for website's infrastructures and far more.