Spin up a Terraria server

This commit is contained in:
Salt 2022-01-12 15:14:30 -06:00
parent 8984f71aee
commit e4805658dc
2 changed files with 37 additions and 0 deletions

View File

@ -20,3 +20,19 @@
- /data/minecraft/botaniapack2-survival/backups
- /data/minecraft/botaniapack2-creative/backups
tags: [ backup ]
- hosts: vm-terraria-1.home.mgmt.desu.ltd
pre_tasks:
- name: include tasks for gameservers
include_tasks: tasks/game/{{ item }}
with_items:
- terraria-thorium.yml
tags: [ always ]
roles:
- role: backup
vars:
backup_s3backup_list_extra:
- /data
- /etc
backup_s3backup_exclude_list_extra:
- /data/terraria-thorium/backups
tags: [ backup ]

View File

@ -0,0 +1,21 @@
# vim:ft=ansible:
- name: docker deploy terraria thorium
docker_container:
name: terraria-thorium
state: started
image: rehashedsalt/tmodloader-docker:v0.11.8.5
restart_policy: unless-stopped
pull: yes
ports:
- 7777:7777
volumes:
- /etc/localtime:/etc/localtime:ro
- /data/terraria-thorium/data:/terraria
- /data/terraria-thorium/config.txt:/terraria/config.txt
tags: [ docker, terraria, thorium ]
- name: assure terraria backup dir
file: path=/data/terraria-thorium/backups state=directory owner=root group=root mode=0755
tags: [ docker, terraria, thorium ]
- name: assure terraria backup cronjob
cron: user=root name=terraria-thorium minute=*/30 job="tar czvf \"/data/terraria-thorium/backups/world-$(date +%Y-%m-%d-%H%M).tgz\" /data/terraria-thorium/data/ModLoader/Worlds"
tags: [ docker, terraria, thorium ]