39 lines
932 B
YAML
39 lines
932 B
YAML
- 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:
|
|
src: ./filesystem/{{ ansible_hostname }}/etc/systemd/system/syncoid-service-data.service.j2
|
|
dest: /etc/systemd/system/syncoid-service-data.service
|
|
mode: 0644
|
|
register: systemd_syncoid_service_data_service_file
|
|
|
|
- name: SystemD daemon reload
|
|
systemd:
|
|
daemon_reload: true
|
|
when:
|
|
systemd_syncoid_service_data_service_file is changed
|
|
|
|
- name: Enable the replication service
|
|
systemd:
|
|
name: syncoid-service-data.service
|
|
enabled: yes
|
|
|
|
- name: Enable the sanoid timer
|
|
systemd:
|
|
name: sanoid.timer
|
|
enabled: yes
|
|
state: started
|