Terraform provider passing changes

Signed-off-by: main <magic_rb@redalder.org>
This commit is contained in:
main 2022-07-31 07:46:24 +02:00
parent 40346346df
commit 1542021f7e
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E
4 changed files with 48 additions and 25 deletions

18
main.tf
View file

@ -9,13 +9,13 @@ terraform {
provider "nomad" { provider "nomad" {
address = "http://10.64.1.201:4646" address = "http://10.64.1.201:4646"
region = "homelab-1" region = "homelab-1"
alias = "homelab" alias = "homelab-1"
} }
provider "nomad" { provider "nomad" {
address = "http://10.64.1.201:4646" address = "http://10.64.1.201:4646"
region = "do-1" region = "do-1"
alias = "do" alias = "do-1"
} }
provider "vault" { provider "vault" {
@ -38,15 +38,6 @@ variable "flake_sha" {
type = string type = string
} }
module "infrastructure" {
source = "./infrastructure"
flake_rev = var.flake_rev
flake_host = var.flake_host
flake_host_alt = var.flake_host_alt
flake_sha = var.flake_sha
}
module "nomad" { module "nomad" {
source = "./nomad" source = "./nomad"
@ -54,4 +45,9 @@ module "nomad" {
flake_host = var.flake_host flake_host = var.flake_host
flake_host_alt = var.flake_host_alt flake_host_alt = var.flake_host_alt
flake_sha = var.flake_sha flake_sha = var.flake_sha
providers = {
nomad.do-1 = nomad.do-1
nomad.homelab-1 = nomad.homelab-1
}
} }

View file

@ -1,3 +1,14 @@
terraform {
required_providers {
nomad = {
configuration_aliases = [
nomad.do-1,
nomad.homelab-1
]
}
}
}
variable "flake_rev" { variable "flake_rev" {
type = string type = string
} }
@ -21,4 +32,9 @@ module "regions" {
flake_host = var.flake_host flake_host = var.flake_host
flake_host_alt = var.flake_host_alt flake_host_alt = var.flake_host_alt
flake_sha = var.flake_sha flake_sha = var.flake_sha
providers = {
nomad.do-1 = nomad.do-1
nomad.homelab-1 = nomad.homelab-1
}
} }

View file

@ -1,3 +1,9 @@
terraform {
required_providers {
nomad = {}
}
}
variable "flake_rev" { variable "flake_rev" {
type = string type = string
} }
@ -14,30 +20,16 @@ variable "flake_host_alt" {
type = string type = string
} }
provider "nomad" {
address = "http://10.64.1.201:4646"
region = "do-1"
alias = "do-1"
}
module "nfs" { module "nfs" {
source = "../../modules/nfs" source = "../../modules/nfs"
node_dcs = [ "do-1" ] node_dcs = [ "do-1" ]
region = "do-1" region = "do-1"
providers = {
nomad = nomad.do-1
}
} }
module "gateway-mesh" { module "gateway-mesh" {
source = "../../modules/gateway-mesh" source = "../../modules/gateway-mesh"
datacenters = [ "do-1" ] datacenters = [ "do-1" ]
providers = {
nomad = nomad.do-1
}
} }

View file

@ -1,3 +1,14 @@
terraform {
required_providers {
nomad = {
configuration_aliases = [
nomad.do-1,
nomad.homelab-1
]
}
}
}
variable "flake_rev" { variable "flake_rev" {
type = string type = string
} }
@ -21,6 +32,10 @@ module "do-1" {
flake_host = var.flake_host flake_host = var.flake_host
flake_host_alt = var.flake_host_alt flake_host_alt = var.flake_host_alt
flake_sha = var.flake_sha flake_sha = var.flake_sha
providers = {
nomad = nomad.do-1
}
} }
module "homelab-1" { module "homelab-1" {
@ -30,4 +45,8 @@ module "homelab-1" {
flake_host = var.flake_host flake_host = var.flake_host
flake_host_alt = var.flake_host_alt flake_host_alt = var.flake_host_alt
flake_sha = var.flake_sha flake_sha = var.flake_sha
providers = {
nomad = nomad.homelab-1
}
} }