StalkingKillah / ansible-role-sftp

SFTP Role for Ansible

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ansible Role for SFTP Build Status

Role for setting up SFTP access.

Requirements

No pre-requisites.

Role Variables

  • sftp_group_name - name of the user group allowed to login via SFTP (default: sftp-users)
  • sftp_user_home_tld - top level home directory in which user home directories are to be created (default: /home)
  • sftp_user_shell - default shell for created users. (default: /sbin/nologin)
  • sftp_allow_passwords - should password logins be allowed. (default: no)
  • sftp_additional_directories - list of additional directories (can be a dictionary with defined fields: name, mode) to be created at the end of the role. (default: [])
  • sftp_users - list of dictionaries with defined fields: name (username), password (should be hashed), key (authorized ssh key, string)

Dependencies

No dependencies.

Example Playbook

If role is pulled from github, role name should be ansible-role-sftp.

If role is installed from ansible galaxy, role name should be StalkingKillah.sftp

- hosts: all
  remote_user: root
  vars:
    - users:
      - name: "sftptestuser1"
        password: "{{ password_hash('THISROCKS', 'sha512') }}"
  roles:
    - role: StalkingKillah.sftp
      sftp_users: "{{ users }}"
      sftp_additional_directories:
        - test1
        - test2
        - test3

License

MIT

Author Information

Author: Djordje Stojanovic

About

SFTP Role for Ansible

License:MIT License