ansible/roles/backup/tasks/main.yml

15 lines
658 B
YAML
Raw Normal View History

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