ansible/roles/backup/tasks/main.yml

13 lines
509 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: configure systemd service
template: src=backup.service dest=/etc/systemd/system/backup.service
- name: configure systemd timer
template: src=backup.timer dest=/etc/systemd/system/backup.timer
notify: restart backup timer
- name: enable timer
systemd: name=backup.timer state=started enabled=yes daemon_reload=yes