functioning minecraft server
This commit is contained in:
@@ -4,22 +4,17 @@
|
||||
# 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:
|
||||
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(',') }}"
|
||||
env: "{{ minecraft_env_base }}"
|
||||
restart_policy: always
|
||||
recreate: true
|
||||
state: started
|
||||
@@ -32,4 +27,23 @@
|
||||
- "19132:19132/udp"
|
||||
network:
|
||||
- npm_internal
|
||||
ip: '{{ minecraft_ip }}'
|
||||
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"
|
||||
Reference in New Issue
Block a user