Skip to content

Commit

Permalink
Remove constraint (#320)
Browse files Browse the repository at this point in the history
We have 3 nodes, so setting distinct_hosts and count = 3 is not
reachable state.
  • Loading branch information
lens0021 authored Oct 7, 2024
1 parent 0a9935c commit c0c333a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
21 changes: 3 additions & 18 deletions jobs/fastcgi.nomad
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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"
}
}
Expand Down
1 change: 0 additions & 1 deletion terraform/mediawiki.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ resource "nomad_job" "fastcgi_green" {
hcl2 {
allow_fs = true
vars = {
green = true
mysql_password_mediawiki = var.mysql_password_mediawiki
}
}
Expand Down

0 comments on commit c0c333a

Please sign in to comment.