backup_server: Rename role
This commit is contained in:
parent
80b7adbcf8
commit
c07cf4804a
3 changed files with 1 additions and 1 deletions
64
roles/backup_server/tasks/main.yml
Normal file
64
roles/backup_server/tasks/main.yml
Normal file
|
@ -0,0 +1,64 @@
|
|||
---
|
||||
- name: install packages
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: installed
|
||||
with_items:
|
||||
- git
|
||||
- rclone
|
||||
|
||||
- name: create backup group
|
||||
group:
|
||||
name: backup
|
||||
gid: 1005
|
||||
|
||||
- name: create backup user
|
||||
user:
|
||||
name: backup
|
||||
comment: Backup Service
|
||||
createhome: false
|
||||
group: backup
|
||||
home: /var/empty
|
||||
shell: /bin/sh
|
||||
uid: 1005
|
||||
|
||||
- name: create backup directory
|
||||
file:
|
||||
path: /export/backup
|
||||
state: directory
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
|
||||
- name: link backup directory
|
||||
file:
|
||||
dest: /srv/backup
|
||||
src: /export/backup
|
||||
state: link
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
follow: false
|
||||
|
||||
- name: create bitbucket backup directory
|
||||
file:
|
||||
path: /export/backup/bitbucket.org
|
||||
state: directory
|
||||
mode: 0775
|
||||
owner: root
|
||||
group: backup
|
||||
|
||||
- name: install bitbucket backup script
|
||||
copy:
|
||||
dest: /usr/local/sbin/backup-bitbucket
|
||||
src: backup-bitbucket.py
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
|
||||
- name: add bitbucket backup cron job
|
||||
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