Skip to content

Latest commit

 

History

History
95 lines (66 loc) · 5.54 KB

README.md

File metadata and controls

95 lines (66 loc) · 5.54 KB

Startup Infra for Small Self-hosted Projects

Ansible GitHub Actions Docker Vagrant Terraform

This repository provides Ansible playbooks to set up a minimal infrastructure for a simple self-hosted application. Ideal for small hobby projects. I made this repository a place to Learn about DevOps and Cloud Infrastructure. You have all the tutorial you need to get started.

Features:

  • docker-swarm
  • Caddy
  • Portainer
  • Prometheus
  • Graphana

Articles and Tutorials

The articles/tutorials are divided into sections.

  • Introduction -> What are the tools to manage infrastructure? Perfect to learn the basis.
  • How-tos -> Good takeaway from this project - Answers many questions you could encounter in the future
  • Main quest -> Deploy the Infrastructure using Ansible, Terraform and Github Action
  • Deepening Understanding -> Learn more about each application used in this setup (Portainer, Graphana, Caddy, etc.)

I used DigitalOcean for experiments because it is cheap, but any cloud provider should work, as we are mainly playing with Virtual Machines. You can even get $200 DigitalOcean free credit when starting

  • Don't forget to delete everything after a tutorial if you don't want to add unnecessary costs

Tools Introduction

Learn the Tools

Main Quest - Put it all together

Learn about the applications used in this setup

Deep Dives

Below, I've included some explainers on how I solved a specific problem when I encountered it. This should demistify some of the magic happening in this repo.

Ansible

Architecture

Handy toolchain

Do you want to go fast? Too lazy to set up your local environment?

Then, use the tools from a Docker container. I included a simple Toochain in this repository and a useful alias for it.

Use common infrastructure tools in docker with:

source ./bin/docker_tools_alias.sh
use dasb for ansible in docker
use dap for ansible-playbook in docker
use daws for awscli in docker
use dpk for packer in docker
use dtf for terraform in docker
use dbash for bash in docker

Scale Up

With docker swarm and portainer it because easy to manager multiple nodes.