Add Minecraft server
This commit is contained in:
parent
3ef6a17e9f
commit
2d9b554372
5
group_vars/gaming/vars.yml
Normal file
5
group_vars/gaming/vars.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
|
---
|
||||||
|
base_domain: gaming.sapti.me
|
||||||
|
internal_subnet: 10.0.24.0/24
|
6
group_vars/mcservers/vars.yml
Normal file
6
group_vars/mcservers/vars.yml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
|
---
|
||||||
|
apps_include:
|
||||||
|
- minecraft
|
||||||
|
- watchtower
|
7
host_vars/sapt-labg-mc01.yml
Normal file
7
host_vars/sapt-labg-mc01.yml
Normal 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
|
|
@ -55,6 +55,12 @@ app_stage
|
||||||
db_stage
|
db_stage
|
||||||
mda_stage
|
mda_stage
|
||||||
|
|
||||||
|
[mc_game]
|
||||||
|
sapt-labg-mc01
|
||||||
|
|
||||||
|
[gaming:children]
|
||||||
|
mc_game
|
||||||
|
|
||||||
[publicservers:children]
|
[publicservers:children]
|
||||||
pub_cloud
|
pub_cloud
|
||||||
|
|
||||||
|
@ -79,10 +85,14 @@ mda_stage
|
||||||
db_prod
|
db_prod
|
||||||
db_stage
|
db_stage
|
||||||
|
|
||||||
|
[mcservers:children]
|
||||||
|
mc_game
|
||||||
|
|
||||||
[home:children]
|
[home:children]
|
||||||
shared
|
shared
|
||||||
production
|
production
|
||||||
staging
|
staging
|
||||||
|
gaming
|
||||||
|
|
||||||
[virtualservers:children]
|
[virtualservers:children]
|
||||||
cloud
|
cloud
|
||||||
|
|
|
@ -56,6 +56,15 @@ apps_vars:
|
||||||
port: 22300
|
port: 22300
|
||||||
version: 2.14.2-beta
|
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:
|
monerod:
|
||||||
backup: false
|
backup: false
|
||||||
sender: false
|
sender: false
|
||||||
|
|
10
roles/apps/tasks/extra_tasks/minecraft.yml
Normal file
10
roles/apps/tasks/extra_tasks/minecraft.yml
Normal 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
|
18
roles/apps/templates/compose-files/minecraft.yml.j2
Normal file
18
roles/apps/templates/compose-files/minecraft.yml.j2
Normal 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"
|
6
site.yml
6
site.yml
|
@ -16,13 +16,15 @@
|
||||||
name: docker
|
name: docker
|
||||||
when: hostname in groups['appservers'] or
|
when: hostname in groups['appservers'] or
|
||||||
hostname in groups['proxyservers'] or
|
hostname in groups['proxyservers'] or
|
||||||
hostname in groups['publicservers']
|
hostname in groups['publicservers'] or
|
||||||
|
hostname in groups['mcservers']
|
||||||
|
|
||||||
- name: Include role 'apps'
|
- name: Include role 'apps'
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: apps
|
name: apps
|
||||||
when: hostname in groups['appservers'] or
|
when: hostname in groups['appservers'] or
|
||||||
hostname in groups['publicservers']
|
hostname in groups['publicservers'] or
|
||||||
|
hostname in groups['mcservers']
|
||||||
|
|
||||||
- name: Include role 'postgresql'
|
- name: Include role 'postgresql'
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
|
|
Loading…
Reference in a new issue