From bc6c826713d2f0f99573f2956fa56e1348197001 Mon Sep 17 00:00:00 2001 From: lens0021 Date: Tue, 8 Oct 2024 00:48:27 +0900 Subject: [PATCH] Remove constraint We have 3 nodes, so setting distinct_hosts and count = 3 is not reachable state. --- jobs/fastcgi.nomad | 21 +++------------------ terraform/mediawiki.tf | 1 - 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/jobs/fastcgi.nomad b/jobs/fastcgi.nomad index bae8d43..ca1d60d 100644 --- a/jobs/fastcgi.nomad +++ b/jobs/fastcgi.nomad @@ -1,25 +1,11 @@ -variable "green" { - type = bool - default = false -} - variable "mysql_password_mediawiki" { type = string default = "" } -locals { - blue = !var.green -} - job "fastcgi" { datacenters = ["dc1"] - constraint { - operator = "distinct_hosts" - value = true - } - group "fastcgi" { count = 3 @@ -225,10 +211,9 @@ job "fastcgi" { } update { - auto_revert = true - auto_promote = var.green ? true : false - # canary count equal to the desired count allows a Nomad job to model blue/green deployments - canary = var.green ? 1 : 0 + auto_revert = true + auto_promote = true + canary = 1 progress_deadline = "1h" } } diff --git a/terraform/mediawiki.tf b/terraform/mediawiki.tf index b282c3b..43c023d 100644 --- a/terraform/mediawiki.tf +++ b/terraform/mediawiki.tf @@ -40,7 +40,6 @@ resource "nomad_job" "fastcgi_green" { hcl2 { allow_fs = true vars = { - green = true mysql_password_mediawiki = var.mysql_password_mediawiki } }