weareinteractive.vsftpd

Ansible weareinteractive.vsftpd Role

Build Status Galaxy GitHub Tags GitHub Stars

weareinteractive.vsftpd is an Ansible role that:

  • Installs vsftpd (Very Secure FTP Daemon)
  • Configures vsftpd
  • Manages users

Note:

This role has moved from franklinkim.vsftpd to weareinteractive.vsftpd since Ansible Galaxy now supports organizations!

Installation

To install using ansible-galaxy:

$ ansible-galaxy install weareinteractive.vsftpd

To install using requirements.yml:

- src: weareinteractive.vsftpd

To install using git:

$ git clone https://github.com/weareinteractive/ansible-vsftpd.git weareinteractive.vsftpd

Dependencies

  • Ansible version should be 2.4 or higher
  • Requires the weareinteractive.openssl role if SSL is enabled

Variables

Here are the default variables for this role, available in defaults/main.yml.

---
# Define the package name and version
vsftpd_package: vsftpd
# List of users to create (empty by default)
vsftpd_users: []
# Should the service start on boot?
vsftpd_service_enabled: yes
# Current state of the service: started or stopped
vsftpd_service_state: started
# Enable SSL by default?
vsftpd_enable_ssl: true
# Default SSL key file
vsftpd_key_file: ssl-cert-snakeoil.key
# Default SSL certificate file
vsftpd_cert_file: ssl-cert-snakeoil.pem
# Configuration options
vsftpd_config: {}
# Path to the config template
vsftpd_config_template:
# SELinux booleans for RedHat systems (optional)
vsftpd_seboolean: {}

Handlers

Handlers are defined in handlers/main.yml.

---
- name: restart vsftpd
  service:
    name: vsftpd
    state: restarted
  when: vsftpd_service_state != 'stopped'
  ignore_errors: yes # Ignore specific errors

Usage

Here is an example playbook:

---
- hosts: all
  roles:
    - weareinteractive.vsftpd
  vars:
    vsftpd_users:
       - username: ftpuser
         name: FTP User
         password: "{{ 'ftpuser' | password_hash('sha256', 'mysecretsalt') }}"
    vsftpd_config:
      listen_port: 990
      local_enable: YES
      write_enable: YES
      chroot_local_user: YES
      xferlog_enable: YES
      log_ftp_protocol: YES
      allow_writeable_chroot: YES

Testing

To test the role, run the following commands:

$ git clone https://github.com/weareinteractive/ansible-vsftpd.git
$ cd ansible-vsftpd
$ make test

Contributing

If you want to contribute, please follow these steps:

  1. Fork the repository
  2. Create a new branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to your branch (git push origin my-new-feature)
  5. Create a Pull Request

Note: To update the README.md file, install and run ansible-role:

$ gem install ansible-role
$ ansible-role docgen

License

Copyright (c) We Are Interactive under the MIT license.

Informazioni sul progetto

Installs, configures and adds user for vsftpd

Installa
ansible-galaxy install weareinteractive.vsftpd
Licenza
mit
Download
204.9k
Proprietario