49 lines
1.9 KiB
YAML
49 lines
1.9 KiB
YAML
---
|
|
# Paper Minecraft server with Geyser (Bedrock<->Java bridge) + Floodgate (Bedrock auth without Java account).
|
|
# Java players: mc.boxswapper.io:25565 (TCP); Bedrock players: mc.boxswapper.io:19132 (UDP) - Geyser translates, Floodgate authenticates.
|
|
# External prerequisites (NOT managed by this repo):
|
|
# - Cloudflare A record mc.boxswapper.io -> public IP (grey-cloud, like vpn.boxswapper.io)
|
|
# - Router port forwards: TCP 25565 + UDP 19132 -> 10.10.0.45
|
|
- name: Create Minecraft data directory
|
|
ansible.builtin.file:
|
|
path: /opt/apps/minecraft/data
|
|
state: directory
|
|
mode: '0755'
|
|
|
|
- name: Deploy Minecraft Server
|
|
containers.podman.podman_container:
|
|
image: docker.io/itzg/minecraft-server:latest
|
|
name: minecraft
|
|
env: "{{ minecraft_env_base }}"
|
|
restart_policy: always
|
|
recreate: true
|
|
state: started
|
|
volumes:
|
|
- /opt/apps/minecraft/data:/data:z
|
|
- /usr/share/zoneinfo/America/Denver:/etc/timezone:ro
|
|
- /etc/localtime:/etc/localtime:ro
|
|
ports:
|
|
- "25565:25565"
|
|
- "19132:19132/udp"
|
|
network:
|
|
- npm_internal
|
|
ip: '{{ minecraft_ip }}'
|
|
vars:
|
|
minecraft_env_base:
|
|
EULA: "TRUE"
|
|
TYPE: PAPER
|
|
VERSION: "{{ minecraft_version }}"
|
|
MEMORY: "{{ minecraft_memory }}"
|
|
MOTD: "{{ minecraft_motd }}"
|
|
DIFFICULTY: "{{ minecraft_difficulty }}"
|
|
GAMEMODE: "{{ minecraft_gamemode }}"
|
|
MAX_PLAYERS: "{{ minecraft_max_players }}"
|
|
VIEW_DISTANCE: "{{ minecraft_view_distance }}"
|
|
ONLINE_MODE: "{{ minecraft_online_mode }}"
|
|
PLUGINS: "{{ minecraft_plugins | join(',') }}"
|
|
# Open server (no whitelist). Explicit FALSE so mc-image-helper writes white-list=false
|
|
# into server.properties on every boot (a stale TRUE would otherwise block all joins).
|
|
ENABLE_WHITELIST: "FALSE"
|
|
# Enables /tmp/minecraft-console-in so `podman exec minecraft mc-send-to-console "<cmd>"`
|
|
# works for admin commands.
|
|
CREATE_CONSOLE_IN_PIPE: "TRUE" |