homeserver/roles/mgrote_todoist_backup/tasks/main.yml

52 lines
1.2 KiB
YAML
Raw Normal View History

2024-09-27 17:57:20 +02:00
---
2024-09-27 18:02:28 +02:00
- name: 'Clone "full-offline-backup-for-todoist"'
2024-09-27 18:10:25 +02:00
become: true
2024-09-27 18:02:28 +02:00
ansible.builtin.git:
repo: 'https://github.com/joanbm/full-offline-backup-for-todoist'
dest: /shares_backup/full-offline-backup-for-todoist
2024-09-27 17:57:20 +02:00
2024-09-27 18:28:09 +02:00
- name: Ensure script is present
2024-09-27 18:27:43 +02:00
become: true
ansible.builtin.template:
src: "todoist_backup.sh.j2"
dest: "/usr/bin/todoist_backup.sh"
owner: root
group: root
mode: "0754"
2024-09-27 18:02:28 +02:00
- name: Ensure services are present
2024-09-27 17:57:20 +02:00
become: true
ansible.builtin.template:
2024-09-27 18:02:28 +02:00
src: "{{ item }}.j2"
dest: "/etc/systemd/system/{{ item }}"
2024-09-27 17:57:20 +02:00
owner: root
group: root
mode: "0644"
notify:
- systemctl daemon-reload
2024-09-27 18:02:28 +02:00
loop:
- todoist_backup.service
- todoist_backup.timer
- todoist_backup_mail.service
- name: Ensure timer unit is enabled
become: true
ansible.builtin.systemd:
name: todoist_backup.timer
enabled: true
masked: false
state: started
notify:
- systemctl daemon-reload
- name: Ensure service units are enabled
become: true
ansible.builtin.systemd:
name: "{{ item }}"
masked: false
enabled: true
loop:
- todoist_backup.service
- todoist_backup.timer
- todoist_backup_mail.service