This Ansible role deploy self-hosted minecraft server with minecraft-client-rs for control.
So to run the playbook you will need:
- Ansible 2.12 on management node
- Alpine Linux >= 3.17 with python3 installed on managed node
If you don't want to use compiled minecraft-cli binary, you can compile it yourself from the project sources (minecraft-client-rs) and put it to role files.
Create the playbook minecraft.yaml like below and override some variables
- hosts: minecraft.your-domain.local
roles:
- minecraft
become: True
become_method: su
vars:
#CHANGE_THIS_PASSWORDS
- minecraft_rcon_pass: rc0n_Pas$w0rdAnd run this playbook with ansible-playbook
user@host:~$ ansible-playbook minecraft.yamlminecraft_path— path to server filesminecraft_user— user which will run serverminecraft_group— group which will run serveminecraft_jvm_max_ram— max RAM size in MB which will be used by JVMminecraft_jvm_init_ram— start RAM size in MB which will be used by JVMminecraft_jvm_extra_opts— extra options to JVMminecraft_server_url— URL to server jar-fileminecraft_server_ip— server IPminecraft_rcon_port— RCON portminecraft_rcon_pass— RCON passwordminecraft_minecraft_cli_path— path to minecraft-cli binaryminecraft_server_shutdown_message— notification before server shutdownminecraft_server_shutdown_delay— delay before server shutdownminecraft_eula— accept EULA, defaultfalse