backup_bitbucket: New role
This commit is contained in:
parent
7496125098
commit
0d72e9e920
3 changed files with 59 additions and 0 deletions
32
roles/backup_bitbucket/tasks/main.yml
Normal file
32
roles/backup_bitbucket/tasks/main.yml
Normal file
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
- name: Install dependencies
|
||||
ansible.builtin.package:
|
||||
name: "{{ item }}"
|
||||
state: installed
|
||||
with_items:
|
||||
- git
|
||||
- jq
|
||||
|
||||
- name: Create backup directory
|
||||
ansible.builtin.file:
|
||||
path: /srv/backup/bitbucket.org
|
||||
state: directory
|
||||
mode: "0770"
|
||||
owner: root
|
||||
group: backup
|
||||
|
||||
- name: Copy backup script
|
||||
ansible.builtin.copy:
|
||||
dest: /usr/local/sbin/backup-bitbucket
|
||||
src: backup-bitbucket.sh
|
||||
mode: "0755"
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
|
||||
- name: Add cron job
|
||||
ansible.builtin.cron:
|
||||
name: bitbucket-backup
|
||||
job: /usr/local/sbin/backup-bitbucket
|
||||
hour: "03"
|
||||
minute: "10"
|
||||
user: backup
|
Loading…
Add table
Add a link
Reference in a new issue