diff --git a/core/exporters.tf b/core/exporters.tf new file mode 100644 index 0000000..8025bae --- /dev/null +++ b/core/exporters.tf @@ -0,0 +1,5 @@ +resource "nomad_job" "exporters" { + jobspec = templatefile("${path.module}/exporters.nomad", { + use_wesher = var.use_wesher, + }) +} diff --git a/core/metrics.tf b/core/grafana.tf similarity index 83% rename from core/metrics.tf rename to core/grafana.tf index 1265f53..5252dd5 100644 --- a/core/metrics.tf +++ b/core/grafana.tf @@ -1,17 +1,3 @@ -resource "nomad_job" "exporters" { - jobspec = templatefile("${path.module}/exporters.nomad", { - use_wesher = var.use_wesher, - }) -} - -resource "nomad_job" "prometheus" { - jobspec = templatefile("${path.module}/prometheus.nomad", { - use_wesher = var.use_wesher, - }) - - detach = false -} - resource "nomad_job" "grafana" { jobspec = templatefile("${path.module}/grafana.nomad", { module_path = path.module @@ -117,3 +103,15 @@ module "grafana_oidc" { task = "grafana" } } + +# resource "nomad_variable" "grafana_config" { +# for_each = fileset("${path.module}/grafana", "**") +# +# path = "nomad/jobs/grafana/${replace(each.key, ".", "_")}" +# items = { +# path = "${each.key}" +# value = file("${path.module}/grafana/${each.key}") +# left_delimiter = endswith(each.key, ".json") ? "<<<<" : "{{" +# right_delimiter = endswith(each.key, ".json") ? ">>>>" : "}}" +# } +# } diff --git a/core/prometheus.tf b/core/prometheus.tf new file mode 100644 index 0000000..323a017 --- /dev/null +++ b/core/prometheus.tf @@ -0,0 +1,7 @@ +resource "nomad_job" "prometheus" { + jobspec = templatefile("${path.module}/prometheus.nomad", { + use_wesher = var.use_wesher, + }) + + detach = false +}