32 lines
641 B
YAML
32 lines
641 B
YAML
---
|
|
- name: Install dependencies
|
|
ansible.builtin.package:
|
|
name: "{{ item }}"
|
|
state: installed
|
|
with_items:
|
|
- git
|
|
- jq
|
|
|
|
- name: Create backup directory
|
|
ansible.builtin.file:
|
|
path: /srv/backup/github.com
|
|
state: directory
|
|
mode: "0770"
|
|
owner: root
|
|
group: backup
|
|
|
|
- name: Copy backup script
|
|
ansible.builtin.copy:
|
|
dest: /usr/local/sbin/backup-github
|
|
src: backup-github.sh
|
|
mode: "0755"
|
|
owner: root
|
|
group: "{{ ansible_wheel }}"
|
|
|
|
- name: Add cron job
|
|
ansible.builtin.cron:
|
|
name: github-backup
|
|
job: /usr/local/sbin/backup-github
|
|
hour: "03"
|
|
minute: "20"
|
|
user: backup
|