ansible/roles/backup/tasks/main.yml

15 lines
658 B
YAML

#!/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
template: src=backup.service dest=/etc/systemd/system/backup.service mode=0644
- name: configure systemd timer
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