From ea46afcb0041dd0777f88543a369db03c3a1b3ea Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Mon, 27 Sep 2021 19:34:25 -0400 Subject: [PATCH] bit of work on ftp --- roles/ftp/tasks/main.yml | 43 ++++++++++++------ .../ftp/templates/{proftpd => }/blacklist.dat | Bin roles/ftp/templates/{proftpd => }/ldap.conf | 0 .../ftp/templates/{proftpd => }/modules.conf | 0 .../ftp/templates/{proftpd => }/proftpd.conf | 0 roles/ftp/templates/proftpd/conf.d/.gitkeep | 0 roles/ftp/templates/{proftpd => }/sql.conf | 0 roles/ftp/templates/{proftpd => }/tls.conf | 0 .../ftp/templates/{proftpd => }/virtuals.conf | 0 9 files changed, 28 insertions(+), 15 deletions(-) rename roles/ftp/templates/{proftpd => }/blacklist.dat (100%) rename roles/ftp/templates/{proftpd => }/ldap.conf (100%) rename roles/ftp/templates/{proftpd => }/modules.conf (100%) rename roles/ftp/templates/{proftpd => }/proftpd.conf (100%) delete mode 100644 roles/ftp/templates/proftpd/conf.d/.gitkeep rename roles/ftp/templates/{proftpd => }/sql.conf (100%) rename roles/ftp/templates/{proftpd => }/tls.conf (100%) rename roles/ftp/templates/{proftpd => }/virtuals.conf (100%) diff --git a/roles/ftp/tasks/main.yml b/roles/ftp/tasks/main.yml index ecc0b03..e830dce 100644 --- a/roles/ftp/tasks/main.yml +++ b/roles/ftp/tasks/main.yml @@ -1,8 +1,17 @@ +--- - name: install proftpd apt: name: proftpd state: present update_cache: yes +- name: enable proftpd service + service: + name: proftpd + enabled: yes +- name: start proftpd service + service: + name: proftpd + state: started # make `/mirror/root` dir @@ -12,20 +21,24 @@ # double check perms # proftpd requires modules (how to install ?) -- name: Copy assets +- name: copy over config files copy: - src: "{{ role_path }}/templates/proftpd.conf" - dest: /etc/proftpd/proftpd.conf - # owner: root - # group: root - # mode: "0755" + src: "{{ role_path }}/templates/{{ item.src }}" + dest: "/etc/proftpd/{{ item.dest }}" + owner: root + group: root + mode: "{{ item.mode }}" + loop: + - { src: blacklist.dat, dest: blacklist.dat, mode: "644" } + - { src: dhparams.pem, dest: dhparams.pem, mode: "644" } + - { src: ldap.conf, dest: ldap.conf, mode: "600" } + - { src: modules.conf, dest: modules.conf, mode: "644" } + - { src: proftpd.conf, dest: proftpd.conf, mode: "644" } + - { src: sql.conf, dest: sql.conf, mode: "600" } + - { src: tls.conf, dest: tls.conf, mode: "644" } + - { src: virtuals.conf, dest: virtuals.conf, mode: "644" } - -# also need to get -# /etc/proftpd/blacklist.dat (binary) -# /etc/proftpd/dhparams.pem (maybe not) -# /etc/proftpd/ldap.conf (unable to read) -# /etc/proftpd/modules.conf (and maybe everything in /usr/lib/proftpd/) -# /etc/proftpd/sql.conf (unable to read) -# /etc/proftpd/tls.conf -# /etc/proftpd/virtuals.conf \ No newline at end of file +- name: reload proftpd service + service: + name: proftpd + state: reloaded diff --git a/roles/ftp/templates/proftpd/blacklist.dat b/roles/ftp/templates/blacklist.dat similarity index 100% rename from roles/ftp/templates/proftpd/blacklist.dat rename to roles/ftp/templates/blacklist.dat diff --git a/roles/ftp/templates/proftpd/ldap.conf b/roles/ftp/templates/ldap.conf similarity index 100% rename from roles/ftp/templates/proftpd/ldap.conf rename to roles/ftp/templates/ldap.conf diff --git a/roles/ftp/templates/proftpd/modules.conf b/roles/ftp/templates/modules.conf similarity index 100% rename from roles/ftp/templates/proftpd/modules.conf rename to roles/ftp/templates/modules.conf diff --git a/roles/ftp/templates/proftpd/proftpd.conf b/roles/ftp/templates/proftpd.conf similarity index 100% rename from roles/ftp/templates/proftpd/proftpd.conf rename to roles/ftp/templates/proftpd.conf diff --git a/roles/ftp/templates/proftpd/conf.d/.gitkeep b/roles/ftp/templates/proftpd/conf.d/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/roles/ftp/templates/proftpd/sql.conf b/roles/ftp/templates/sql.conf similarity index 100% rename from roles/ftp/templates/proftpd/sql.conf rename to roles/ftp/templates/sql.conf diff --git a/roles/ftp/templates/proftpd/tls.conf b/roles/ftp/templates/tls.conf similarity index 100% rename from roles/ftp/templates/proftpd/tls.conf rename to roles/ftp/templates/tls.conf diff --git a/roles/ftp/templates/proftpd/virtuals.conf b/roles/ftp/templates/virtuals.conf similarity index 100% rename from roles/ftp/templates/proftpd/virtuals.conf rename to roles/ftp/templates/virtuals.conf