/setup-multiple-servers-ansible-terraform

Setup multiple servers with New Users and SSH Key Auth and various software using Ansible and Terraform

Primary LanguageHTMLMIT LicenseMIT

setup-multiple-servers-ansible-terraform

🚀 Setup multiple servers with New Users and SSH Key Auth and various software using Ansible and Terraform 🚀

https://github.com/coding-to-music/setup-multiple-servers-ansible-terraform

From / By https://github.com/mr-karan/homelab

My point-in-time cloned version is https://github.com/coding-to-music/hydra

This repo version is with many enhancements so is not forked, it is cloned and modified

GitHub

git init
git add .
git remote remove origin
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:coding-to-music/setup-multiple-servers-ansible-terraform.git
git push -u origin main

Environment variables:

# See file terraform/env.sample

DIGITALOCEAN_TOKEN=

CLOUDFLARE_API_TOKEN=

TF_VAR_cloudflare_caddy_api_token=

TF_VAR_shynet_postgresql_password=
TF_VAR_shynet_django_secret_key=
TF_VAR_gitea_secret_key=
TF_VAR_gitea_internal_token=
TF_VAR_gitea_lfs_jwt_secret=
TF_VAR_gitea_oauth2_jwt_secret=

TF_VAR_restic_b2_account_id=
TF_VAR_restic_b2_account_key=
TF_VAR_restic_repository=
TF_VAR_restic_password=

# See file terraform/variables.tf

# See file terraform/providers.tf

# See ansible/

# See file ansible/README.md

# See file ansible/ansible.cfg

# See file ansible/Makefile

# See file ansible/playbook.yml

# See file ansible/Makefile

# See file ansible/inventory.sample
# See file ansible/inventory.hydra

URL's and domain names

see TODO.md

the original project uses these domains:

nomad.mrkaran.dev consul.mrkaran.dev shynet.mrkaran.dev

DOMAIN           = git.mrkaran.dev
SSH_DOMAIN       = koadings.mrkaran.dev
ROOT_URL         = https://git.mrkaran.dev/

Ports

gitea
HTTP_PORT        = 3000

hydra

Setup scripts for my homelab

Calvin and Hobbes


Overview

  • Single node Nomad server for running workloads.
  • Consul agent co-located for service discovery.
  • Ansible scripts to boostrap the node.
  • Terraform modules for managing the following services:
    • Nomad jobs
    • Cloudflare DNS
    • DigitalOcean Infra
  • Tailscale VPN for connectivity to internal services.
  • Caddy as a reverse proxy for all web services.

Services Running

Blog Posts

Here's a collection of posts I've written which shows how Hydra has evolved over the years:

Setup Instructions

Visit SETUP.md for following instructions on setting up Nomad and Consul.