- manage nomad jobs - create makefile - create gitignore - manage terragrunt environments - add build/deploy jobs
This commit is contained in:
@@ -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")
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user