Add Template to deploy forgejo.
This template allows deploying a forgejo en either Scaleway or Hetzner (untested) without much knowledge about them. It DOES require knowledge about Terragrunt and ansible. A wizard of sorts is provided but it will not guarantee success without some knowledge about the underlying technology.
This commit is contained in:
parent
a9f546f92a
commit
822e42dbb8
48 changed files with 6846 additions and 2 deletions
63
terraform/hetzner/root.hcl
Normal file
63
terraform/hetzner/root.hcl
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
# Hetzner Root Configuration
|
||||
# This file contains common configuration for all Hetzner resources
|
||||
|
||||
locals {
|
||||
# Project configuration
|
||||
project_name = "forgejo"
|
||||
environment = "production"
|
||||
|
||||
# Hetzner configuration
|
||||
location = "nbg1" # Nuremberg, Germany
|
||||
|
||||
# Labels for resource organization
|
||||
common_labels = {
|
||||
project = "forgejo"
|
||||
environment = "production"
|
||||
managed-by = "terragrunt"
|
||||
}
|
||||
}
|
||||
|
||||
# Generate provider configuration
|
||||
generate "provider" {
|
||||
path = "provider.tf"
|
||||
if_exists = "overwrite_terragrunt"
|
||||
contents = <<EOF
|
||||
terraform {
|
||||
required_version = ">= 1.5.0"
|
||||
|
||||
required_providers {
|
||||
hcloud = {
|
||||
source = "hetznercloud/hcloud"
|
||||
version = "~> 1.45"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "hcloud" {
|
||||
# Token should be set via environment variable:
|
||||
# HCLOUD_TOKEN
|
||||
}
|
||||
EOF
|
||||
}
|
||||
|
||||
# Remote state configuration
|
||||
remote_state {
|
||||
backend = "local"
|
||||
|
||||
config = {
|
||||
path = "${get_parent_terragrunt_dir()}/terraform.tfstate"
|
||||
}
|
||||
|
||||
generate = {
|
||||
path = "backend.tf"
|
||||
if_exists = "overwrite_terragrunt"
|
||||
}
|
||||
}
|
||||
|
||||
# Input values available to all child configurations
|
||||
inputs = {
|
||||
project_name = local.project_name
|
||||
environment = local.environment
|
||||
location = local.location
|
||||
common_labels = local.common_labels
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue