Skip to content

Terraform + Ansible project for provisioning and configuring a Minecraft server on Azure.

Notifications You must be signed in to change notification settings

lariskovski/minecraft-azure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minecraft Server IaC

Provision, configure and manage a Minecraft server on Azure.

Based on this project

Executing The Project

Requirements

  • Ansible

  • Terraform

  • A Service Principal account and the following values: subscription_id, client_id, client_secret, tenant_id

  • Create SSH key. Default vars look to ~/.ssh/azure-mine.pub and ~/.ssh/azure-mine

Terraform Execution

Add the required values on vars.out.tfvars or pass them via env vars.

Note: Terraform makes use of the local-exec provisioner to call the Ansible Playbook.

Once the vars are set and the SSH keys in place, execute the follwing:

terraform -chdir=terraform/ init
terraform -chdir=terraform/ plan -out plano
terraform -chdir=terraform/ apply plano

Connecting to the Server

Copy the public_ip output and add as the minecraft server on the client application.

Alternatively, if you only want to check it's working check Minecraft Server Stat.

World Backup

If you have a world backup locally you can send it directly to the server as port 22 is open or sending it to an storage account then downloading it from the server. The second aproach is also good if you want to setup a cron job for future backups, which is recommended.

Storage Account Creationg and World Upload

Example SA setup:

  • Create storage account called minebkp and container called mine (or any other creative names you'd like)

  • Go to Storage Account > Access Key (accountkey)

SA=minebkp
CONTAINER=mine
AKEY=XXXXXX
# compress your world file
tar -cf world.tar world/
az storage blob upload --file ./world.tar/ --container $CONTAINER --account-name $SA --name latest --account-key $AKEY

Good Reads

Integrating Terraform and Ansible

About

Terraform + Ansible project for provisioning and configuring a Minecraft server on Azure.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published