46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
---
|
|
|
|
# ---
|
|
# Configure PureFTP Daemon
|
|
# ---
|
|
|
|
# Remove old current configurations if exists
|
|
|
|
- name: Upload Pure-FTPd global configuration file.
|
|
template:
|
|
src: etc/default/pure-ftpd-common.j2
|
|
dest: "{{ pureftpd_global_config_file }}"
|
|
owner: root
|
|
group: root
|
|
mode: '0644'
|
|
notify: restart Pure-FTPd
|
|
|
|
- name: (pure-ftpd-install.yml) Compile Pure-FTPd configurations (set fact..).
|
|
set_fact:
|
|
pureftpd_config_compiled: "{{ pureftpd_config }}"
|
|
|
|
- name: (pure-ftpd-install.yml) Get current configuration.
|
|
command: ls -1 {{ pureftpd_config_conf_dir }}
|
|
register: pureftpd_current_config
|
|
changed_when: false
|
|
|
|
- name: (pure-ftpd-install.yml) Delete old configuration.
|
|
file:
|
|
path: "{{ pureftpd_config_conf_dir }}/{{ item }}"
|
|
state: absent
|
|
when: pureftpd_config_compiled[item] is not defined
|
|
with_items: "{{ pureftpd_current_config.stdout_lines }}"
|
|
notify: restart Pure-FTPd
|
|
|
|
# write new configuration
|
|
|
|
- name: (pure-ftpd-install.yml) Write configuration.
|
|
template:
|
|
src: etc/pure-ftpd/conf/config.j2
|
|
dest: "{{ pureftpd_config_conf_dir }}/{{ item.key }}"
|
|
owner: root
|
|
group: root
|
|
mode: '0644'
|
|
with_dict: '{{ pureftpd_config_compiled }}'
|
|
notify: restart Pure-FTPd
|