Add waiting for loki and prom dependencies in core

This commit is contained in:
IamTheFij 2023-09-27 21:30:22 -07:00
parent df4737655a
commit ad439d48f3
5 changed files with 13 additions and 0 deletions

View File

@ -1,5 +1,6 @@
module "loki" { module "loki" {
source = "../services/service" source = "../services/service"
detach = false
name = "loki" name = "loki"
image = "grafana/loki:2.2.1" image = "grafana/loki:2.2.1"

View File

@ -18,6 +18,8 @@ resource "nomad_job" "nomad-client-stalker" {
resource "nomad_job" "syslog-ng" { resource "nomad_job" "syslog-ng" {
jobspec = file("${path.module}/syslogng.nomad") jobspec = file("${path.module}/syslogng.nomad")
depends_on = [module.loki]
} }
resource "nomad_job" "ddclient" { resource "nomad_job" "ddclient" {

View File

@ -8,6 +8,8 @@ resource "nomad_job" "prometheus" {
jobspec = templatefile("${path.module}/prometheus.nomad", { jobspec = templatefile("${path.module}/prometheus.nomad", {
use_wesher = var.use_wesher, use_wesher = var.use_wesher,
}) })
detach = false
} }
resource "nomad_job" "grafana" { resource "nomad_job" "grafana" {

View File

@ -39,6 +39,8 @@ resource "nomad_job" "service" {
mysql_bootstrap = var.mysql_bootstrap mysql_bootstrap = var.mysql_bootstrap
postgres_bootstrap = var.postgres_bootstrap postgres_bootstrap = var.postgres_bootstrap
}) })
detach = var.detach
} }
resource "nomad_acl_policy" "secrets_mysql" { resource "nomad_acl_policy" "secrets_mysql" {

View File

@ -3,6 +3,12 @@ variable "name" {
description = "Name of the service" description = "Name of the service"
} }
variable "detach" {
type = bool
default = true
description = "Detach from Nomad and not wait for job to start"
}
variable "instance_count" { variable "instance_count" {
type = number type = number
default = 1 default = 1