From 41daabf5a509d2154b92111307ddd22416f1668a Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Wed, 23 Jan 2019 21:46:28 +0100 Subject: [PATCH] also support create/not of dir --- README.md | 1 + defaults/main.yml | 2 ++ tasks/main.yml | 8 ++++++++ 3 files changed, 11 insertions(+) diff --git a/README.md b/README.md index 0f4dc1d..3231820 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ Role Variables SQLConnectInfo documentation for the "connection-info" parameter][proftpd-sql-connect-info] for details. - `galaxy_user`: The name of the user running the Galaxy server. - `galaxy_ftp_upload_dir`: Path to the Galaxy FTP upload directory, should match `ftp_upload_dir` in your Galaxy config. + - `proftpd_create_ftp_upload_dir` can be used to allow the role to create this with owner `galaxy_user` - Additionally, you should set `User` and `Group` in `proftpd_options` to the user and group names of your Galaxy user. [proftpd-sql-connect-info]: http://www.proftpd.org/docs/contrib/mod_sql.html#SQLConnectInfo diff --git a/defaults/main.yml b/defaults/main.yml index 7030056..000a8ea 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -25,3 +25,5 @@ proftpd_tls_sesscache_timeout: 300 proftpd_tls_renegotiate: null proftpd_deploy_ssl: false + +proftpd_create_ftp_upload_dir: false diff --git a/tasks/main.yml b/tasks/main.yml index 39d2d6a..bd2823a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -70,6 +70,14 @@ backup: yes with_items: "{{ proftpd_virtualhosts | default([]) }}" +- name: Create parent ftp directory if needed + file: + path: "{{ galaxy_ftp_upload_dir }}" + owner: "{{ galaxy_user }}" + mode: "0750" + state: directory + when: proftpd_create_ftp_upload_dir + - name: Ensure ProFTPD is started and enabled service: name: proftpd