From 9962c09fb5f9be4bfefa3533888973c59179552a Mon Sep 17 00:00:00 2001 From: Jacob Babor Date: Wed, 1 Jan 2025 16:00:49 -0600 Subject: [PATCH] Add tModLoader template --- playbooks/tasks/game/tmodloader-generic.yml | 55 +++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 playbooks/tasks/game/tmodloader-generic.yml diff --git a/playbooks/tasks/game/tmodloader-generic.yml b/playbooks/tasks/game/tmodloader-generic.yml new file mode 100644 index 0000000..8b7be77 --- /dev/null +++ b/playbooks/tasks/game/tmodloader-generic.yml @@ -0,0 +1,55 @@ +# vim:ft=ansible: +# +# Docs available here: +# https://github.com/JACOBSMILE/tmodloader1.4 +# +# If you need to run a command in this container: +# docker exec tmodloader inject "say Hello World!" +# +- name: set backups tmodloader - generic + vars: + backup_dirs: + - "/data/tmodloader/generic/data/tModLoader/Worlds" + ansible.builtin.cron: + user: root + name: terraria-generic-backup + state: present + minute: "*/15" + job: "tar czvf \"/data/tmodloader/generic/backups/world-$(date +%Y-%m-%d-%H%M).tgz\" {{ backup_dirs | join(' ') }}" + tags: [ docker, tmodloader, generic, cron, backup, tar ] +- name: assure backups dir tmodloader - generic + ansible.builtin.file: + path: /data/tmodloader/generic/backups + state: directory + owner: root + group: root + mode: "0700" + tags: [ docker, tmodloader, generic, file, directory, backup ] +- name: docker deploy tmodloader - generic + vars: + tmodloader_workshop_ids_generic: + - "" + community.general.docker_container: + name: tmodloader-generic + state: started + image: jacobsmile/tmodloader1.4:latest + env: + TMOD_AUTODOWNLOAD: "{{ tmodloader_workshop_ids_generic | join(',') }}" + TMOD_ENABLEDMODS: "{{ tmodloader_workshop_ids_generic | join(',') }}" + TMOD_SHUTDOWN_MESSAGE: "Server is going down NOW!" + TMOD_MOTD: "Da bois doin da Terraria again lesgo" + TMOD_PASS: "dicks" + TMOD_WORLDNAME: "Seaborgium" + #TMOD_WORLDSEED: "foobar" + # 0 Normal + # 1 Expert + # 2 Master + # 3 Journey + TMOD_DIFFICULTY: "1" + TMOD_PORT: "7777" + ports: + - "7777:7777/tcp" + - "7777:7777/udp" + volumes: + - /data/tmodloader/generic/data:/data + tags: [ docker, tmodloader, generic ]