add nomad login

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

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 -]]
] ]
} }