add nomad login

This commit is contained in:
IamTheFij 2022-09-06 14:47:06 -07:00
parent 478f9c4c8f
commit f44e62fd1c
2 changed files with 19 additions and 0 deletions

16
core.tf
View File

@ -15,6 +15,22 @@ module "traefik" {
base_hostname = var.base_hostname base_hostname = var.base_hostname
} }
module "nomad_login" {
source = "./levant"
template_path = "service.nomad"
variables = {
name = "nomad-login"
image = "iamthefij/nomad-vault-login"
service_port = 5000
ingress = true
ingress_rule = "Host(`nomad.thefij.rocks`) && PathPrefix(`/login`)"
env = jsonencode({
VAULT_ADDR = "http://$${attr.unique.network.ip-address}:8200",
})
}
}
module "metrics" { module "metrics" {
source = "./metrics" source = "./metrics"
} }

View File

@ -110,6 +110,9 @@ job "[[.name]]" {
[[ if default false .ingress -]] [[ if default false .ingress -]]
"traefik.enable=true", "traefik.enable=true",
"traefik.http.routers.[[.name]].entryPoints=websecure", "traefik.http.routers.[[.name]].entryPoints=websecure",
[[ if not (empty .ingress_rule) -]]
"traefik.http.routers.[[.name]].rule=[[.ingress_rule]]",
[[ end -]]
[[ end -]] [[ end -]]
] ]
} }