2022-02-28 12:07:34 -08:00
|
|
|
variable "base_hostname" {
|
2022-04-13 14:01:14 -07:00
|
|
|
type = string
|
2022-02-28 12:07:34 -08:00
|
|
|
description = "Base hostname to serve content from"
|
2022-04-13 14:01:14 -07:00
|
|
|
default = "dev.homelab"
|
2022-02-28 12:07:34 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
locals {
|
2022-03-13 10:13:19 -07:00
|
|
|
config_data = templatefile(
|
|
|
|
"${path.module}/config.yml",
|
|
|
|
{
|
2022-11-02 12:32:27 -07:00
|
|
|
"base_hostname" = var.base_hostname,
|
2022-03-13 10:13:19 -07:00
|
|
|
}
|
|
|
|
)
|
2022-02-28 12:07:34 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "nomad_job" "blocky" {
|
|
|
|
hcl2 {
|
|
|
|
enabled = true
|
|
|
|
vars = {
|
2022-11-02 12:32:27 -07:00
|
|
|
"config_data" = local.config_data,
|
2022-02-28 12:07:34 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
jobspec = file("${path.module}/blocky.nomad")
|
|
|
|
}
|