EMBL-EBI-TSI/ansible-sftp

Name: ansible-sftp

Owner: EMBL-EBI Technology & Science Integration

Description: SFTP server role for Ansible

Forked from: johanmeiring/ansible-sftp

Created: 2016-12-01 09:17:56.0

Updated: 2016-12-01 09:22:24.0

Pushed: 2016-12-01 15:55:06.0

Homepage: null

Size: 18

Language: Groff

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

SFTP-Server

Build Status

An Ansible role which configures an OpenSSH server for chrooted SFTP access. The role is built in such a way that it will not unnecessarily alter a user's OpenSSH customisations. Instead, it simply changes the crucial bits that it needs to, and adds the rest of its configuration in the form of a custom config block (OpenSSH's lack of some form of conf.d/ support forces this behaviour).

Requirements

It is advisable that scp_if_ssh be set to true in the ssh_connection section of your ansible.cfg file, seeing as how Ansible uses SFTP for file transfers by default, and you can easily lock yourself out of your server's SFTP by using this role. The SCP fallback will continue to work. Example config:

sible.cfg

_connection]
if_ssh=True

Other than that, only Ansible itself is required. Tested using Ansible 1.9, 2.0.2.0 and 2.1.0.0. Works on Ubuntu 14.04 and 16.04 as well as CentOS 7, untested on other versions.

Role Variables

The following role variables are relevant:

Example Playbook

me: test-playbook | Test sftp-server role
sts: all
come: yes
come_user: root
rs:
- sftp_users:
  - name: peter
    password: "$1$salty$li5TXAa2G6oxHTDkqx3Dz/" # passpass
    authorized: []
  - name: sally
    password: ""
    authorized: [sally.pub]
- sftp_directories:
  - imports
  - exports
  - { name: public, mode: 755 }
  - other
les:
- sftp-server
License

Licensed under the MIT License. See the LICENSE file for details.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.