Deploying a minecraft server requires lots of configuration and the commands we need to run and interfaces we need to interact with can be cumbersome and tedious to do manually. Because of this, we will make use of Terraform and Ansible to allocate infrastructure and configure a minecraft server automatically.
In order to run the pipeline, you will need to have the following installed, as well as their dependencies (e.g. Python for Ansible)
You will need to rename the .credentials_template
to .credentials
and fill in with your AWS access key, secret key, and session token.
To deploy the Minecraft Server, run the following
$ ssh-keygen -f minecraft
- follow the prompts for creating a key pair, taking care to select no passphrase
$ terraform init
$ terraform fmt
$ terraform apply
$ chmod +x format.sh
$ ./format.sh
$ ansible-playbook playbooks/install_minecraft.yaml -i hosts
$ terraform output server_ip
You can now connect to the Minecraft server using the IP and port that were output.