2022-10-14 21:32:51 +02:00
|
|
|
- name: Install sanoid
|
|
|
|
apt:
|
|
|
|
name: sanoid
|
|
|
|
|
|
|
|
- name: Create sanoid directory
|
|
|
|
file:
|
|
|
|
path: /etc/sanoid
|
|
|
|
state: directory
|
|
|
|
mode: 0755
|
|
|
|
|
|
|
|
- name: Configure sanoid
|
|
|
|
template:
|
|
|
|
src: ./filesystem/{{ ansible_hostname }}/etc/sanoid/sanoid.conf.j2
|
|
|
|
dest: /etc/sanoid/sanoid.conf
|
|
|
|
|
|
|
|
- name: Copy service for {{ ansible_hostname }} data replication
|
|
|
|
template:
|
2022-10-30 16:21:07 +01:00
|
|
|
src: ./filesystem/{{ ansible_hostname }}/etc/systemd/system/syncoid-volume-data.service.j2
|
|
|
|
dest: /etc/systemd/system/syncoid-volume-data.service
|
2022-10-14 21:32:51 +02:00
|
|
|
mode: 0644
|
2022-10-30 16:21:07 +01:00
|
|
|
register: systemd_syncoid_volume_data_service_file
|
2022-10-14 21:32:51 +02:00
|
|
|
|
|
|
|
- name: SystemD daemon reload
|
|
|
|
systemd:
|
|
|
|
daemon_reload: true
|
|
|
|
when:
|
2022-10-30 16:21:07 +01:00
|
|
|
systemd_syncoid_volume_data_service_file is changed
|
2022-10-14 21:32:51 +02:00
|
|
|
|
|
|
|
- name: Enable the replication service
|
|
|
|
systemd:
|
2022-10-30 16:21:07 +01:00
|
|
|
name: syncoid-volume-data.service
|
2022-10-14 21:32:51 +02:00
|
|
|
enabled: yes
|
|
|
|
|
|
|
|
- name: Enable the sanoid timer
|
|
|
|
systemd:
|
|
|
|
name: sanoid.timer
|
|
|
|
enabled: yes
|
|
|
|
state: started
|