Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dhzdhd/mcserver
Infrastructure for a minecraft server hosted on an Azure VM
https://github.com/dhzdhd/mcserver
ansible azure docker iac minecraft pulumi server
Last synced: 7 days ago
JSON representation
Infrastructure for a minecraft server hosted on an Azure VM
- Host: GitHub
- URL: https://github.com/dhzdhd/mcserver
- Owner: dhzdhd
- License: apache-2.0
- Created: 2024-11-30T13:54:41.000Z (about 1 month ago)
- Default Branch: master
- Last Pushed: 2024-12-23T15:09:09.000Z (19 days ago)
- Last Synced: 2024-12-23T15:34:58.485Z (19 days ago)
- Topics: ansible, azure, docker, iac, minecraft, pulumi, server
- Language: Python
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Minecraft Server
## Setup
### Prerequisites
- Download [Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html), [Pulumi](https://www.pulumi.com/docs/iac/download-install/), [RClone](https://rclone.org/install/), [Poetry](https://python-poetry.org/docs/#installation) and [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli)
- Run `az login` to login to your Microsoft account for Pulumi
- Create a remote for storing backups by running - `rclone --config ./rclone.config config` and follow the instructions shown.
- Create a `.env` file using `.env-example` as a template
- Download backups from OneDrive if they exist (only the needed `.tgz` file)
- Run `pulumi config set azure-native:location `
- Install all Ansible roles with `ansible-galaxy install -r requirements.yml`### Local setup
- Copy the preferred backup `.tgz` file to `backups/` directory
- Run `poetry install` in `iac/pulumi` directory
- Run `pulumi -C iac/pulumi up -y`
- Copy the IP address returned by pulumi to `ansible_host` key in the `cloudgroup` group in `iac/ansible/hosts.yml`
- Run `ansible-playbook --ask-become-pass -i iac/ansible/hosts.yml iac/ansible/playbooks/main.yml`
- Access the server at `:25565`### Shutdown & Cleanup
- Run `pulumi -C iac/pulumi down -y`
## Configuration
### Server config
- To change server name/VM/location/image..., edit `iac/pulumi/Pulumi.dev.yaml`
- To edit Ansible host config, edit `iac/ansible/hosts.yaml`### Minecraft config
- To change Minecraft server settings/commands on startup..., edit the environment section in the `mcserver` service in `docker-compose.yml`
## Credit
- [itzg Docker Minecraft server](https://github.com/itzg/docker-minecraft-server)
- [itzg Docker Minecraft backup server](https://github.com/itzg/docker-mc-backup)