64 lines
1.3 KiB
YAML
64 lines
1.3 KiB
YAML
---
|
|
# For installation instruction, see /usr/share/doc/ftpsync/README.md.gz
|
|
# Not everything is up to date in this README, be careful!
|
|
- name: Install ftpsync
|
|
apt:
|
|
update_cache: true
|
|
name: ftpsync
|
|
register: apt_result
|
|
retries: 3
|
|
until: apt_result is succeeded
|
|
|
|
# cron run as mirror user
|
|
- name: Add the mirror user
|
|
user:
|
|
name: mirror
|
|
home: /var/mirror # unused, should be something empty
|
|
shell: /bin/false
|
|
|
|
- name: Create /etc/ftpsync directory
|
|
file:
|
|
path: "{{ item }}"
|
|
owner: root
|
|
group: root
|
|
mode: 0755
|
|
state: directory
|
|
loop:
|
|
- /etc/ftpsync
|
|
- "{{ ftpsync.root }}/.html"
|
|
|
|
- name: Create root directory
|
|
file:
|
|
path: "{{ ftpsync.root }}"
|
|
owner: mirror
|
|
group: mirror
|
|
mode: 0755
|
|
state: directory
|
|
|
|
- name: Copy ftpsync configurations
|
|
template:
|
|
src: ftpsync.conf.j2
|
|
dest: /etc/ftpsync/ftpsync-{{ item.name }}.conf
|
|
loop: "{{ ftpsync.targets }}"
|
|
|
|
- name: Configure ftpsync cron
|
|
template:
|
|
src: ftpsync-cron.j2
|
|
dest: /etc/cron.d/ftpsync
|
|
|
|
- name: Indicate role in motd
|
|
template:
|
|
src: update-motd.d/05-service.j2
|
|
dest: /etc/update-motd.d/05-ftpsync
|
|
mode: 0755
|
|
|
|
- name: Copy configuration files
|
|
template:
|
|
src: html/{{ item }}.j2
|
|
dest: "{{ ftpsync.root }}/.html/{{ item }}"
|
|
mode: 0644
|
|
loop:
|
|
- HEADER.html
|
|
- FOOTER.html
|
|
- style.min.css
|