Polish up that Terraria role some more

This commit is contained in:
Salt 2020-05-15 10:49:42 -05:00
parent c514fb4183
commit 6e1bf6a467
5 changed files with 30 additions and 3 deletions

View File

@ -90,9 +90,12 @@
vars:
terraria_name: "vanilla1"
terraria_zip: "https://terraria.org/server/terraria-server-1344.zip"
terraria_port: "7777"
terraria_worldsize: "large"
terraria_password: "dicks"
terraria_worldsize: 3
terraria_motd: "New major release edition"
terraria_worldname: "Blitzballs"
terraria_port: 7777
terraria_difficulty: 1
- hosts: tag_minecraft_ultreload
roles:
- role: backups

View File

@ -1 +1,6 @@
terraria_difficulty: 0
terraria_motd: "Please don't cut the purple trees!"
terraria_port: 7777
terraria_root: "/var/terraria"
terraria_worldname: "World"
terraria_worldsize: 3

View File

@ -55,6 +55,12 @@
dest: "{{ terraria_root }}/{{ terraria_name }}"
- name: Move zip contents
shell: mv "{{ terraria_root }}/{{ terraria_name }}/Dedicated Server/*" "{{ terraria_root }}/{{ terraria_name }}"
- name: Create worlds directory
file:
path: "{{ terraria_root }}/{{ terraria_name }}/worlds"
owner: terraria
group: ter-admin
state: directory
when: not stat_server_binary.stat.exists
- name: Configure server
block:

View File

@ -0,0 +1,13 @@
# This configuration file is deployed via Ansible
# Changes made here will be overwritten!
maxplayers=8
world={{ terraria_root }}/{{ terraria_name }}/worlds/world.wld
port={{ terraria_port }}
password={{ terraria_password }}
motd={{ terraria_motd }}
worldpath={{ terraria_root }}/{{ terraria_name }}/worlds
autocreate={{ terraria_worldsize }}
difficulty={{ terraria_difficulty }}
worldname={{ terraria_worldname }}
banlist=banlist.txt
secure=1

View File

@ -21,7 +21,7 @@ ProtectKernelModules=true
# Implies MountAPIVFS=yes
ProtectControlGroups=true
ExecStart=/bin/sh -c '/usr/bin/screen -DmS ter-%i ./TerrariaServer.bin.x86_64'
ExecStart=/bin/sh -c '/usr/bin/screen -DmS ter-%i ./TerrariaServer.bin.x86_64 -c ./config'
ExecStop=/usr/bin/screen -p 0 -S ter-%i -X eval 'stuff "say Server is going down: Service was stopped"\\015'
ExecStop=/usr/bin/screen -p 0 -S ter-%i -X eval 'stuff "exit"\\015'