From 47f15166c5c9bf00e09b4a6d2d4b9d00382a411a Mon Sep 17 00:00:00 2001 From: Lens0021 / Leslie Date: Mon, 7 Oct 2024 20:23:37 +0900 Subject: [PATCH] Run backupbot (#312) --- jobs/backupbot.nomad | 17 ++++++++--------- terraform/backupbot.tf | 5 ++++- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/jobs/backupbot.nomad b/jobs/backupbot.nomad index 60ddc14..1c42761 100644 --- a/jobs/backupbot.nomad +++ b/jobs/backupbot.nomad @@ -1,7 +1,6 @@ -variable "test" { - type = bool - description = "Uses jobs for the test server. Without CSI" - default = false +variable "mysql_password_mediawiki" { + type = string + default = "" } job "backupbot" { @@ -25,6 +24,9 @@ job "backupbot" { env { LOCAL_SETTINGS = "/a/secrets.php" + WG_DB_SERVER = NOMAD_UPSTREAM_ADDR_mysql + WG_DB_USER = "mediawiki" + WG_DB_PASSWORD = var.mysql_password_mediawiki } resources { @@ -32,11 +34,8 @@ job "backupbot" { } } - dynamic "network" { - for_each = var.test ? [{}] : [] - content { - mode = "bridge" - } + network { + mode = "bridge" } } diff --git a/terraform/backupbot.tf b/terraform/backupbot.tf index 5cb148b..90b26a4 100644 --- a/terraform/backupbot.tf +++ b/terraform/backupbot.tf @@ -1,5 +1,5 @@ resource "nomad_job" "backupbot" { - count = 0 + provider = nomad.green depends_on = [nomad_job.mysql_green] detach = false @@ -7,5 +7,8 @@ resource "nomad_job" "backupbot" { hcl2 { allow_fs = true + vars = { + mysql_password_mediawiki = var.mysql_password_mediawiki + } } }