Add more options for minecraft role

This commit is contained in:
Ivan R. 2024-11-22 01:39:59 +05:00
parent ca070782c9
commit 4bee97a542
Signed by: lumin
GPG key ID: E0937DC7CD6D3817
4 changed files with 48 additions and 6 deletions

View file

@ -2,4 +2,7 @@
- hosts: webservers - hosts: webservers
roles: roles:
- name: minecraft - name: minecraft
eula: true
user: 1003:972
server_name: Comfy Camp server_name: Comfy Camp
use_simd_flags: true

View file

@ -1,10 +1,36 @@
argument_specs: argument_specs:
main: main:
options: options:
user:
type: str
eula: eula:
type: bool type: bool
motd:
type: str
server_type: server_type:
type: str type: str
choices:
- VANILLA
- BUKKIT
- SPIGOT
- CANYON
- FABRIC
- FORGE
- NEOFORGE
- MAGMA
- MAGMA_MAINTAINED
- KETTING
- MOHIST
- CATSERVER
- SPONGEVANILLA
- LIMBO
- CRUCIBLE
- CUSTOM
- PAPER
- PUFFERFISH
- PURPUR
- FOLIA
- QUILT
server_version: server_version:
type: str type: str
online_mode: online_mode:
@ -13,5 +39,12 @@ argument_specs:
type: str type: str
difficulty: difficulty:
type: str type: str
tz: choices:
type: str - peaceful
- easy
- normal
- hard
max_players:
type: int
use_simd_flags:
type: bool

View file

@ -9,17 +9,20 @@
image: itzg/minecraft-server:stable image: itzg/minecraft-server:stable
ports: ports:
- "25565:25565" - "25565:25565"
user: "1003:972" user: "{{ user }}"
env: env:
EULA: "{{ eula | string }}" EULA: "{{ eula | string }}"
MOTD: "{{ motd }}"
TYPE: "{{ server_type }}" TYPE: "{{ server_type }}"
VERSION: "{{ server_version }}" VERSION: "{{ server_version }}"
DIFFICULTY: "{{ difficulty }}" DIFFICULTY: "{{ difficulty }}"
ONLINE_MODE: "{{ online_mode | string }}" ONLINE_MODE: "{{ online_mode | string }}"
SERVER_NAME: "{{ server_name }}" SERVER_NAME: "{{ server_name }}"
TZ: "{{ tz }}" MAX_PLAYERS: "{{ max_players | string }}"
USE_SIMD_FLAGS: "{{ use_simd_flags | string }}"
volumes: volumes:
- minecraft:/data - minecraft:/data
- /etc/timezone:/etc/timezone:ro
healthcheck: healthcheck:
test: ["CMD", "mc-health"] test: ["CMD", "mc-health"]
interval: 30s interval: 30s

View file

@ -1,7 +1,10 @@
eula: true motd: A minecraft server
user: "1000:1000"
eula: false
server_type: PAPER server_type: PAPER
server_version: "1.21" server_version: "1.21"
online_mode: false online_mode: false
server_name: Minecraft Server server_name: Minecraft Server
difficulty: hard difficulty: hard
tz: Asia/Yekaterinburg max_players: 20
use_simd_flags: false