homeserver/roles/mgrote_todoist_backup/tasks/main.yml
Michael Grote 6eb88c1c92
Some checks failed
ansible-lint / gitleaks (push) Successful in 6s
ansible-lint / Ansible Lint (push) Failing after 54s
add todoist backup job and role (#194)
Reviewed-on: https://git.mgrote.net///mg/homeserver/pulls/194
Co-authored-by: Michael Grote <michael.grote@posteo.de>
Co-committed-by: Michael Grote <michael.grote@posteo.de>
2024-09-27 18:50:18 +02:00

52 lines
1.2 KiB
YAML

---
- name: 'Clone "full-offline-backup-for-todoist"'
become: true
ansible.builtin.git:
repo: 'https://github.com/joanbm/full-offline-backup-for-todoist'
dest: /shares_backup/full-offline-backup-for-todoist
- name: Ensure script is present
become: true
ansible.builtin.template:
src: "todoist_backup.sh.j2"
dest: "/usr/bin/todoist_backup.sh"
owner: root
group: root
mode: "0754"
- name: Ensure services are present
become: true
ansible.builtin.template:
src: "{{ item }}.j2"
dest: "/etc/systemd/system/{{ item }}"
owner: root
group: root
mode: "0644"
notify:
- systemctl daemon-reload
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