ansible/roles/backup/tasks/main.yml

14 lines
462 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: assure systemd unit and timer
template: src=backup.{{ item }} dest=/etc/systemd/system/backup.{{ item }}
loop:
- service
- timer
notify: restart backup timer
- name: enable systemd timer
systemd: name=backup.timer state=started enabled=yes daemon_reload=yes