Add Minecraft server

This commit is contained in:
Sam A. 2024-07-24 22:03:34 +02:00
parent 3ef6a17e9f
commit 2d9b554372
Signed by: samsapti
GPG key ID: CBBBE7371E81C4EA
8 changed files with 69 additions and 2 deletions

View file

@ -0,0 +1,5 @@
# vim: ft=yaml.ansible
# code: language=ansible
---
base_domain: gaming.sapti.me
internal_subnet: 10.0.24.0/24

View file

@ -0,0 +1,6 @@
# vim: ft=yaml.ansible
# code: language=ansible
---
apps_include:
- minecraft
- watchtower

View file

@ -0,0 +1,7 @@
# vim: ft=yaml.ansible
# code: language=ansible
---
fqdn: sapt-labg-mc01.game.servers.sapti.me
ansible_host: 192.168.24.30
internal_ipv4: 10.0.24.10
instance_type: qemu

View file

@ -55,6 +55,12 @@ app_stage
db_stage
mda_stage
[mc_game]
sapt-labg-mc01
[gaming:children]
mc_game
[publicservers:children]
pub_cloud
@ -79,10 +85,14 @@ mda_stage
db_prod
db_stage
[mcservers:children]
mc_game
[home:children]
shared
production
staging
gaming
[virtualservers:children]
cloud

View file

@ -56,6 +56,15 @@ apps_vars:
port: 22300
version: 2.14.2-beta
minecraft:
backup: false
sender: false
extra_tasks: true
domain: mc01.{{ apps_base_domain }}
port: 25565
geyser_port: 19132
version: latest
monerod:
backup: false
sender: false

View file

@ -0,0 +1,10 @@
# vim: ft=yaml.ansible
# code: language=ansible
---
- name: Create subdirectory for Minecraft server data
ansible.builtin.file:
path: "{{ apps_data_root }}/minecraft/data/server"
owner: '1000'
group: '1000'
mode: u=rwx,g=rx,o=rx
state: directory

View file

@ -0,0 +1,18 @@
{# code: language=ansible-jinja #}
# THIS FILE IS MANAGED BY ANSIBLE
services:
server:
image: itzg/minecraft-server:{{ apps_vars.minecraft.version }}
restart: always
environment:
EULA: true
TYPE: PAPER
PLUGINS: |
https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/spigot
https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot
ports:
- {{ apps_vars.minecraft.port }}:{{ apps_vars.minecraft.port }}/tcp
- {{ apps_vars.minecraft.geyser_port }}:{{ apps_vars.minecraft.geyser_port }}/udp
volumes:
- "./data/server:/data:rw"

View file

@ -16,13 +16,15 @@
name: docker
when: hostname in groups['appservers'] or
hostname in groups['proxyservers'] or
hostname in groups['publicservers']
hostname in groups['publicservers'] or
hostname in groups['mcservers']
- name: Include role 'apps'
ansible.builtin.include_role:
name: apps
when: hostname in groups['appservers'] or
hostname in groups['publicservers']
hostname in groups['publicservers'] or
hostname in groups['mcservers']
- name: Include role 'postgresql'
ansible.builtin.include_role: