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