update
Some checks failed
Deploy Minecraft Server / deploy (push) Failing after 1m25s
Ansible Lint / lint (push) Failing after 12s

This commit is contained in:
2025-08-26 14:28:09 +02:00
parent 0315edf95f
commit 31711c7627
105 changed files with 1419 additions and 366 deletions

View File

@@ -0,0 +1,14 @@
---
- name: Create backup directories
file:
path: "{{ item }}"
state: directory
owner: "{{ minecraft_user }}"
group: "{{ minecraft_group }}"
mode: '0755'
loop:
- "{{ minecraft_backups_dir }}/daily"
- "{{ minecraft_backups_dir }}/weekly"
- "{{ minecraft_backups_dir }}/monthly"
- "{{ minecraft_backups_dir }}/scripts"
tags: ['backup-structure']

View File

@@ -0,0 +1,27 @@
---
- name: Create daily backup script
template:
src: backup-daily.sh.j2
dest: "{{ minecraft_backups_dir }}/scripts/backup-daily.sh"
owner: "{{ minecraft_user }}"
group: "{{ minecraft_group }}"
mode: '0755'
tags: ['backup-scripts']
- name: Create weekly backup script
template:
src: backup-weekly.sh.j2
dest: "{{ minecraft_backups_dir }}/scripts/backup-weekly.sh"
owner: "{{ minecraft_user }}"
group: "{{ minecraft_group }}"
mode: '0755'
tags: ['backup-scripts']
- name: Create monthly backup script
template:
src: backup-monthly.sh.j2
dest: "{{ minecraft_backups_dir }}/scripts/backup-monthly.sh"
owner: "{{ minecraft_user }}"
group: "{{ minecraft_group }}"
mode: '0755'
tags: ['backup-scripts']

View File

@@ -0,0 +1,29 @@
---
- name: Setup daily backup cron job
cron:
name: "Minecraft daily backup"
user: "{{ minecraft_user }}"
minute: "0"
hour: "2"
job: "{{ minecraft_backups_dir }}/scripts/backup-daily.sh"
tags: ['backup-cron']
- name: Setup weekly backup cron job
cron:
name: "Minecraft weekly backup"
user: "{{ minecraft_user }}"
minute: "0"
hour: "3"
weekday: "0"
job: "{{ minecraft_backups_dir }}/scripts/backup-weekly.sh"
tags: ['backup-cron']
- name: Setup monthly backup cron job
cron:
name: "Minecraft monthly backup"
user: "{{ minecraft_user }}"
minute: "0"
hour: "4"
day: "1"
job: "{{ minecraft_backups_dir }}/scripts/backup-monthly.sh"
tags: ['backup-cron']

View File

@@ -0,0 +1,9 @@
---
- name: Create restore script
template:
src: restore.sh.j2
dest: "{{ minecraft_backups_dir }}/scripts/restore.sh"
owner: "{{ minecraft_user }}"
group: "{{ minecraft_group }}"
mode: '0755'
tags: ['backup-restore']

View File

@@ -0,0 +1,16 @@
---
- name: Include backup structure setup tasks
include_tasks: 01-setup-backup-structure.yml
tags: ['backup', 'setup']
- name: Include backup scripts creation tasks
include_tasks: 02-create-backup-scripts.yml
tags: ['backup', 'scripts']
- name: Include cron jobs setup tasks
include_tasks: 03-setup-cron-jobs.yml
tags: ['backup', 'cron']
- name: Include restore script setup tasks
include_tasks: 04-setup-restore-script.yml
tags: ['backup', 'restore']