feat: initial setup
Build / build (pull_request) Failing after 30s

- manage nomad jobs
- create makefile
- create gitignore
- manage terragrunt environments
- add build jobs
This commit is contained in:
2024-12-28 14:17:21 +11:00
parent f7fad0b74f
commit f1f147024c
10 changed files with 342 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
include "root" {
path = find_in_parent_folders("root.hcl")
}
inputs = {
job_files = [
"testapp1",
"testapp2",
]
policy_files = []
}
generate "shared_modules" {
if_exists = "overwrite"
path = "modules.tf"
# Dynamically include the shared/modules.tf content
contents = file("../../shared/modules.tf")
}
generate "shared_variables" {
if_exists = "overwrite"
path = "variables.tf"
# Dynamically include the shared/variables.tf content
contents = file("../../shared/variables.tf")
}
+47
View File
@@ -0,0 +1,47 @@
locals {
vault_addr = "https://vault.service.consul:8200"
nomad_addr = "https://nomad.service.consul:4646"
}
generate "backend" {
path = "backend.tf"
if_exists = "overwrite_terragrunt"
contents = <<EOF
terraform {
backend "consul" {
address = "https://consul.service.consul"
path = "infra/terraform/nomad/${path_relative_to_include()}/state"
scheme = "https"
lock = true
ca_file = "/etc/pki/tls/certs/ca-bundle.crt"
}
}
EOF
}
generate "provider" {
path = "provider.tf"
if_exists = "overwrite_terragrunt"
contents = <<EOF
terraform {
required_providers {
vault = {
source = "hashicorp/vault"
version = "~> 4.5.0"
}
nomad = {
source = "hashicorp/nomad"
version = "~> 2.4.0"
}
}
}
provider "vault" {
address = "${local.vault_addr}"
}
provider "nomad" {
address = "${local.nomad_addr}"
#token = var.nomad_token
}
EOF
}