27 lines
725 B
YAML
27 lines
725 B
YAML
---
|
|
# Configure the rsync daemon on the master
|
|
- name: copy rsync.conf up to the server
|
|
copy:
|
|
src: "{{ rsync.config_file.src }}"
|
|
dest: "{{ rsync.config_file.dest }}"
|
|
notify:
|
|
- restart the rsync service
|
|
when: inventory_hostname == rsync.master
|
|
|
|
- name: configure rsync on the server
|
|
service:
|
|
enabled: yes
|
|
name: "{{ rsync.service_name }}"
|
|
state: started
|
|
when: inventory_hostname == rsync.master
|
|
|
|
# Synchronize the data folder across hosts
|
|
- name: synchronize the data folder
|
|
delegate_to: "{{ rsync.master }}"
|
|
synchronize:
|
|
src: "{{ sync.source }}"
|
|
dest: "{{ sync.destination }}"
|
|
rsync_opts: "{{ rsync.options }}"
|
|
use_ssh_args: yes
|
|
when: inventory_hostname != rsync.master
|