ansible/roles/backup/tasks/main.yml

17 lines
890 B
YAML
Raw Permalink Normal View History

#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
---
- name: template out backup script
2022-06-16 23:45:29 -05:00
ansible.builtin.template: src={{ backup_script }}.sh dest=/opt/backup.sh mode=0700 owner=root group=root
- name: template out analyze script
ansible.builtin.template: src={{ backup_script }}-analyze.sh dest=/opt/analyze.sh mode=0700 owner=root group=root
- name: template out restore script
2022-06-16 23:45:29 -05:00
ansible.builtin.template: src={{ restore_script }}.sh dest=/opt/restore.sh mode=0700 owner=root group=root
- name: configure systemd service
2022-06-16 23:45:29 -05:00
ansible.builtin.template: src=backup.service dest=/etc/systemd/system/backup.service mode=0644
- name: configure systemd timer
2022-06-16 23:45:29 -05:00
ansible.builtin.template: src=backup.timer dest=/etc/systemd/system/backup.timer mode=0644
notify: restart backup timer
- name: enable timer
2022-06-16 23:45:29 -05:00
ansible.builtin.systemd: name=backup.timer state=started enabled=yes daemon_reload=yes