Tasks Update: Backup - Fix backing up Minecraft server

This commit is contained in:
Christer Warén 2024-12-23 03:43:27 +02:00
parent 31468b561f
commit 3efc266ffe
4 changed files with 33 additions and 14 deletions

View File

@ -4,15 +4,34 @@
name: minecraft name: minecraft
state: stopped state: stopped
- name: "Backup - Minecraft - Create Directory"
ansible.builtin.file:
path: ~/data/backups/tmp
state: directory
- name: "Backup - Minecraft - Copy"
ansible.builtin.copy:
src: "~/data/minecraft"
dest: "~/data/backups/tmp/minecraft"
follow: true
- name: "Backup - Minecraft - Delete"
ansible.builtin.file:
path: ~/data/backups/tmp/minecraft/plugins/dynmap/web/tiles
state: absent
- name: "Backup - Minecraft - Save" - name: "Backup - Minecraft - Save"
community.general.archive: community.general.archive:
path: path:
- "~/data/minecraft" - "~/data/backups/tmp/minecraft"
exclude_path:
- "~/data/minecraft/plugins/dynmap/web/tiles"
dest: "~/data/backups/minecraft-{{ ansible_facts.date_time.date }}.zip" dest: "~/data/backups/minecraft-{{ ansible_facts.date_time.date }}.zip"
format: zip format: zip
- name: "Backup - Minecraft - Clean"
ansible.builtin.file:
path: ~/data/backups/tmp/minecraft
state: absent
- name: "Backup - Minecraft - Start" - name: "Backup - Minecraft - Start"
containers.podman.podman_container: containers.podman.podman_container:
name: minecraft name: minecraft

View File

@ -17,7 +17,7 @@
- tls - tls
- name: "Deployer - Certbot - Copy Certificates" - name: "Deployer - Certbot - Copy Certificates"
copy: ansible.builtin.copy:
src: "~/data/certbot/live/{{ cert }}/" src: "~/data/certbot/live/{{ cert }}/"
dest: "~/data/certificates/{{ cert }}/" dest: "~/data/certificates/{{ cert }}/"
follow: true follow: true

View File

@ -1,6 +1,6 @@
--- ---
- name: "Installer - Ansible - Python Library" - name: "Installer - Ansible - Python Library"
pip: ansible.builtin.pip:
name: ansible name: ansible
state: latest state: latest
extra_args: --upgrade extra_args: --upgrade
@ -10,7 +10,7 @@
- ansible - ansible
- name: "Installer : Ansible : Create Folder" - name: "Installer : Ansible : Create Folder"
file: ansible.builtin.file:
path: ~/bin path: ~/bin
state: directory state: directory
tags: tags:
@ -42,7 +42,7 @@
- ansible - ansible
- name: "Installer - Ansible - Dependencies / Python Libraries" - name: "Installer - Ansible - Dependencies / Python Libraries"
pip: ansible.builtin.pip:
name: "{{ library }}" name: "{{ library }}"
state: latest state: latest
extra_args: --upgrade extra_args: --upgrade
@ -62,14 +62,14 @@
loop_var: "library" loop_var: "library"
- name: "Installer : Certbot : Auth Hook - Create Folder" - name: "Installer : Certbot : Auth Hook - Create Folder"
file: ansible.builtin.file:
path: ~/data/certbot/auth-hooks path: ~/data/certbot/auth-hooks
state: directory state: directory
tags: tags:
- certbot - certbot
- name: "Installer : Certbot : Auth Hook - Download" - name: "Installer : Certbot : Auth Hook - Download"
get_url: ansible.builtin.get_url:
url: "https://git.waren.io/warengroup/acme-dns-auth/raw/branch/master/acme-dns-auth.py" url: "https://git.waren.io/warengroup/acme-dns-auth/raw/branch/master/acme-dns-auth.py"
dest: "~/data/certbot/auth-hooks/acme-dns.py" dest: "~/data/certbot/auth-hooks/acme-dns.py"
mode: '700' mode: '700'
@ -104,7 +104,7 @@
- certbot - certbot
- name: "Installer : Schedule : Maintenance" - name: "Installer : Schedule : Maintenance"
cron: ansible.builtin.cron:
name: "Matte - Infra - Maintenance" name: "Matte - Infra - Maintenance"
hour: "*/3" hour: "*/3"
minute: "0" minute: "0"
@ -113,7 +113,7 @@
- cron - cron
- name: "Installer : Schedule : Deployer" - name: "Installer : Schedule : Deployer"
cron: ansible.builtin.cron:
name: "Matte - Infra - Deployer" name: "Matte - Infra - Deployer"
minute: "*/5" minute: "*/5"
job: "~/.venv/ansible/bin/ansible-pull -U ssh://git@github.com/MatteZ02/infra -d ~/.ansible/pull/matte/infra --accept-host-key --private-key ~/.ssh/keys/matte/infra --vault-password-file ~/.ansible/vault/matte.yml tasks.yml -t deployer" job: "~/.venv/ansible/bin/ansible-pull -U ssh://git@github.com/MatteZ02/infra -d ~/.ansible/pull/matte/infra --accept-host-key --private-key ~/.ssh/keys/matte/infra --vault-password-file ~/.ansible/vault/matte.yml tasks.yml -t deployer"
@ -121,7 +121,7 @@
- cron - cron
- name: "Installer : Schedule : Backup" - name: "Installer : Schedule : Backup"
cron: ansible.builtin.cron:
name: "Matte - Infra - Backup" name: "Matte - Infra - Backup"
hour: "5" hour: "5"
minute: "0" minute: "0"

View File

@ -1,6 +1,6 @@
--- ---
- name: "Installer - Ansible - Dependencies / Python Libraries" - name: "Installer - Ansible - Dependencies / Python Libraries"
pip: ansible.builtin.pip:
name: "{{ library }}" name: "{{ library }}"
state: latest state: latest
extra_args: --upgrade extra_args: --upgrade
@ -20,7 +20,7 @@
loop_var: "library" loop_var: "library"
- name: "Maintenance : Ansible : Update" - name: "Maintenance : Ansible : Update"
pip: ansible.builtin.pip:
name: ansible name: ansible
state: latest state: latest
extra_args: --upgrade extra_args: --upgrade