2022-10-19 22:21:32 +02:00
|
|
|
- name: Install the restic backup script
|
|
|
|
copy:
|
2022-10-26 22:09:50 +02:00
|
|
|
src: ./filesystem/{{ ansible_hostname }}/usr/local/sbin/restic-volume-data
|
|
|
|
dest: /usr/local/sbin/restic-volume-data
|
2022-10-19 22:21:32 +02:00
|
|
|
mode: 0755
|
|
|
|
|
|
|
|
- name: Install the restic backup service file
|
|
|
|
template:
|
2022-10-26 22:09:50 +02:00
|
|
|
src: ./filesystem/{{ ansible_hostname }}/etc/systemd/system/restic-volume-data.service.j2
|
|
|
|
dest: /etc/systemd/system/restic-volume-data.service
|
2022-10-19 22:21:32 +02:00
|
|
|
mode: 0644
|
|
|
|
register: systemd_restic_service_data_service_file
|
|
|
|
|
|
|
|
- name: Install the restic backup timer file
|
|
|
|
copy:
|
2022-10-26 22:09:50 +02:00
|
|
|
src: ./filesystem/{{ ansible_hostname }}/etc/systemd/system/restic-volume-data.timer
|
|
|
|
dest: /etc/systemd/system/restic-volume-data.timer
|
2022-10-19 22:21:32 +02:00
|
|
|
mode: 0644
|
|
|
|
register: systemd_restic_service_data_timer_file
|
|
|
|
|
|
|
|
- name: SystemD daemon reload
|
|
|
|
systemd:
|
|
|
|
daemon_reload: true
|
|
|
|
when:
|
|
|
|
systemd_restic_service_data_service_file is changed or
|
|
|
|
systemd_restic_service_data_timer_file is changed
|
|
|
|
|
|
|
|
- name: Enable restic backup
|
|
|
|
systemd:
|
2022-10-26 22:09:50 +02:00
|
|
|
name: restic-volume-data.timer
|
2022-10-19 22:21:32 +02:00
|
|
|
enabled: yes
|
|
|
|
state: started
|