iac/ansible/roles/minecraft_fossils/tasks/main.yaml
Sergei Poljanski f2aa6375fd ansible: retire Minecraft Fossils
The Fabric server holds 8.8 GB of asxpio-services' 15 GB of RAM, more
than everything else on the host together, and the XMPP server moves
here next. Save the world, remove its containers and the daily restart
timer.

The world stays in /opt/minecraft-fossils/data, and in the restic
backups, until it is deleted by hand.

Assisted-by: Claude:opus-5-5
2026-11-12 20:54:22 +04:00

39 lines
1.2 KiB
YAML

---
# Retired: the Fabric server is stopped for good to free its 8 GB of
# RAM. The world stays in /opt/minecraft-fossils/data (and in the restic
# backups) until it is deleted by hand.
- name: Check for the old deployment
ansible.builtin.stat:
path: /opt/minecraft-fossils/docker-compose.yml
register: fossils_compose
- name: Save the world
ansible.builtin.command: docker exec minecraft-fossils rcon-cli save-all flush
when: fossils_compose.stat.exists
register: fossils_save
changed_when: fossils_save.rc == 0
failed_when: false
- name: Stop and remove the containers (data stays)
community.docker.docker_compose_v2:
project_src: /opt/minecraft-fossils
project_name: minecraft-fossils
state: absent
timeout: 120
when: fossils_compose.stat.exists
- name: Disable the daily restart timer
ansible.builtin.systemd:
name: minecraft-fossils-restart.timer
enabled: false
state: stopped
failed_when: false
- name: Remove the restart units
ansible.builtin.file:
path: "/etc/systemd/system/{{ item }}"
state: absent
loop:
- minecraft-fossils-restart.service
- minecraft-fossils-restart.timer
notify: Reload systemd