Add Minecraft serbers

This commit is contained in:
Salt 2020-06-01 21:56:39 -05:00
parent 0241a1db36
commit 8a6a53ff6e
5 changed files with 31 additions and 17 deletions

View File

@ -1,15 +1,23 @@
#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
---
- hosts: terraria.9iron.club
- hosts: game1.9iron.club
roles:
- role: terraria
- role: minecraft
vars:
terraria_name: "1401-farm-master1"
terraria_password: "dicks"
terraria_worldsize: 3
terraria_motd: "New major release edition"
terraria_worldname: "Farman - Master 1"
terraria_port: 7779
terraria_difficulty: 3
tags: [ gameserver, terraria ]
mcname: "rotary-main"
mczip: "https://www.9iron.club/files/rotarypack-server.zip"
mcforge: "1.7.10-10.13.4.1614-1.7.10"
mcmotd: "We hate ourselves edition"
mcport: 25565
mcgamemode: 0
tags: [ gameserver, minecraft ]
- role: minecraft
vars:
mcname: "rotary-test"
mczip: "https://www.9iron.club/files/rotarypack-server.zip"
mcforge: "1.7.10-10.13.4.1614-1.7.10"
mcmotd: "We hate doing things in survival edition"
mcport: 25566
mcgamemode: 0
tags: [ gameserver, minecraft ]

View File

@ -0,0 +1,4 @@
#!/usr/bin/ansible-playbook
# vim:ft=ansible:
mcheapmax: 4096
mcheapmin: 1024

View File

@ -12,4 +12,4 @@ all:
9iron.club:
gameservers:
hosts:
terraria.9iron.club:
game1.9iron.club:

View File

@ -5,3 +5,5 @@ mcmotd: "An Ansible-deployed Minecraft server"
mcleveltype: "default"
mcgensettings: ""
mcgamemode: 0
mcheapmax: 3072
mcheapmin: 512

View File

@ -22,14 +22,14 @@ ProtectKernelModules=true
# Implies MountAPIVFS=yes
ProtectControlGroups=true
ExecStart=/bin/sh -c '/usr/bin/screen -DmS mc-%i /usr/bin/java -Xms512M -Xmx3072M -jar server.jar nogui'
ExecStart=/bin/sh -c '/usr/bin/screen -DmS %i /usr/bin/java -Xms{{ mcheapmin }}M -Xmx{{ mcheapmax }}M -jar server.jar nogui'
ExecReload=/usr/bin/screen -p 0 -S mc-%i -X eval 'stuff "reload"\\015'
ExecReload=/usr/bin/screen -p 0 -S %i -X eval 'stuff "reload"\\015'
ExecStop=/usr/bin/screen -p 0 -S mc-%i -X eval 'stuff "say Server is going down: Service was stopped"\\015'
ExecStop=/usr/bin/screen -p 0 -S mc-%i -X eval 'stuff "save-all"\\015'
ExecStop=/usr/bin/screen -p 0 -S mc-%i -X eval 'stuff "stop"\\015'
ExecStop=/bin/sleep 10
ExecStop=/usr/bin/screen -p 0 -S %i -X eval 'stuff "say Server is going down: Service was stopped"\\015'
ExecStop=/usr/bin/screen -p 0 -S %i -X eval 'stuff "save-all"\\015'
ExecStop=/usr/bin/screen -p 0 -S %i -X eval 'stuff "stop"\\015'
ExecStop=/bin/sleep 5
Restart=always