new version
Some checks failed
Ansible Minecraft CI/CD / Ansible Lint (push) Successful in 8s
Ansible Minecraft CI/CD / Syntax Check (push) Failing after 7s
Ansible Minecraft CI/CD / Deploy to Staging (push) Has been skipped
Ansible Minecraft CI/CD / Deploy to Production (push) Has been skipped

This commit is contained in:
2025-08-27 15:11:08 +02:00
parent 3e64946953
commit 8f0877cd53
105 changed files with 911 additions and 2540 deletions

View File

@@ -1,54 +1,17 @@
# {{ ansible_managed }}
[Unit]
Description=Minecraft Server (Spigot {{ minecraft_version }})
After=network-online.target
Wants=network-online.target
Description=Minecraft Spigot Server
After=network.target
[Service]
Type=simple
Type=forking
User={{ minecraft_user }}
Group={{ minecraft_group }}
WorkingDirectory={{ minecraft_server_dir }}
# Start command with optimized JVM flags
ExecStart=/usr/bin/java \
-Xms{{ minecraft_memory_min }}M \
-Xmx{{ minecraft_memory_max }}M \
{{ jvm_flags }} \
-jar {{ spigot_jar_name }} \
--nogui
# Stop command using mcrcon
ExecStop={{ minecraft_tools_dir }}/mcrcon -H localhost -P {{ rcon_port }} -p "{{ rcon_password }}" stop
# Restart settings
ExecStart=/usr/bin/java -Xmx{{ minecraft_max_memory }} -Xms{{ minecraft_min_memory }} -jar spigot.jar nogui
ExecStop={{ minecraft_tools_dir }}/mcrcon/mcrcon -H 127.0.0.1 -P {{ minecraft_rcon_port }} -p {{ minecraft_rcon_password | default('changeme') }} stop
KillMode=none
TimeoutStopSec=120
Restart=on-failure
RestartSec=10
StartLimitInterval=600
StartLimitBurst=3
# Security settings
PrivateTmp=yes
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths={{ minecraft_base_dir }}
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
RestrictNamespaces=true
RestrictRealtime=true
RestrictSUIDSGID=true
LockPersonality=true
# Resource limits
LimitNOFILE=100000
LimitNPROC=512
# Logging
StandardOutput=journal
StandardError=journal
SyslogIdentifier=minecraft
[Install]
WantedBy=multi-user.target