Skip to content

spacelift-solutions/minesible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

85 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Minesible - The power of OpenTofu + Ansible

Minesible

Minesible is a scalable, on-demand Minecraft server deployment using OpenTofu + Ansible + Spacelift.
Spin up your own Minecraft server in minutes, with persistent world saves to S3 even after infra teardown.


πŸš€ Features

βœ… Deploy Minecraft servers on demand
βœ… Automated configuration with Ansible
βœ… Persist world saves to S3 buckets (passed as a TF_VAR 'TF_VAR_minecraft_s3_bucket' into spacelift)
βœ… Uses Spacelift stack dependencies for clean IaC orchestration


πŸ› οΈ How it works

  1. Opentofu Stack (Stacks/Opentofu/)

    • Provisions an EC2 instance with IAM roles and a random or provided S3 bucket for saves.
    • Uses OpenTofu (Terraform-compatible) to manage infrastructure declaratively.
  2. Ansible Stack (Stacks/Ansible/)

    • Configures the EC2 instance as a Minecraft server with Ansible.
    • Syncs world save files from S3 at startup and uploads periodic backups.
  3. Save Scheduling

    • Uses Spacelift scheduling to run Ansible tasks for world backups hourly.
  4. Destroy Safety

    • Before destroying infra, world saves are zipped and uploaded to your backup bucket to avoid progress loss.

πŸ“¦ Repository Structure

minesible/
β”œβ”€β”€ stacks/
β”‚   β”œβ”€β”€ ansible/      # Ansible playbooks and inventory templates
β”‚   └── opentofu/     # OpenTofu (Terraform) infrastructure code
└── README.md

πŸ“ Usage

  1. Fork or clone this repo:

    github.com/spacelift-solutions/minesible

  2. Update infra/variables.tf if you want to pass a pre-created bucket name.
  3. Create two Spacelift stacks:
    • Infra stack (OpenTofu) with your AWS integration context.
    • Config stack (Ansible) with SSH key context and stack dependency on the infra stack.
  4. Adjust stack-specific custom hooks or scheduling as needed.
  5. Run the infra stack to deploy.
  6. Config stack will auto run to configure your server and sync world saves.

✨ Future Ideas

  • βœ… Self-service ready for customer blueprints *done
  • βœ… Supports scheduled world backups (using scheduling via private workers) *done
  • Region-specific variable (eg. options like us-east2)
  • βœ… Instance type variable (eg. options like t2.micro) *done
  • Automatic Discord status notifications

Happy mining! ⛏️

Built with ❀️ to showcase the power of IaC automation.


About

πŸš€ Minesible: Deploy on-demand Minecraft servers with persistent world saves using OpenTofu, Ansible, and Spacelift stack dependencies.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors