27 lines
665 B
YAML
27 lines
665 B
YAML
#!/usr/bin/ansible-playbook
|
|
# vim:ft=ansible:
|
|
---
|
|
- name: Set up general backups
|
|
block:
|
|
- name: Create backups directories
|
|
file:
|
|
state: directory
|
|
mode: "0700"
|
|
path: "{{ item }}"
|
|
loop:
|
|
- "{{ backups_dir }}"
|
|
- "{{ backups_outdir }}"
|
|
- "{{ backups_modulesdir }}"
|
|
- name: Template out backup script
|
|
template:
|
|
src: "backup.sh"
|
|
dest: "{{ backups_script }}"
|
|
mode: "0700"
|
|
- name: Set backup cronjob
|
|
cron:
|
|
minute: "0"
|
|
hour: "2"
|
|
name: ansible-backup
|
|
job: "{{ backups_script }} >> {{ backups_outdir }}/backups.log 2>&1"
|
|
become: yes
|