Skip to content

Commit

Permalink
Remove Blue resources
Browse files Browse the repository at this point in the history
  • Loading branch information
lens0021 committed Oct 6, 2024
1 parent 4717ca2 commit 83a6957
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 68 deletions.
2 changes: 1 addition & 1 deletion terraform/backupbot.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource "nomad_job" "backupbot" {
provider = nomad.green
count = 0
count = 1
depends_on = [nomad_job.mysql_green]

detach = false
Expand Down
1 change: 1 addition & 0 deletions terraform/base.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ data "terraform_remote_state" "aws" {
}

provider "nomad" {
alias = "blue"
address = "http://${data.terraform_remote_state.aws.outputs.nomad_blue_public_ip}:4646"
secret_id = var.nomad_token
# Should be specified explicitly because of the bug https://github.com/femiwiki/nomad/issues/99
Expand Down
35 changes: 0 additions & 35 deletions terraform/mediawiki.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ resource "nomad_job" "mysql_green" {
}
}

resource "nomad_job" "memcached" {
jobspec = file("../jobs/memcached.nomad")
detach = false

hcl2 {
allow_fs = true
}
}

resource "nomad_job" "memcached_green" {
provider = nomad.green
jobspec = file("../jobs/memcached.nomad")
Expand All @@ -37,19 +28,6 @@ resource "nomad_job" "memcached_green" {
}
}

resource "nomad_job" "fastcgi" {
depends_on = [
nomad_job.memcached,
]

jobspec = file("../jobs/fastcgi.nomad")
detach = false

hcl2 {
allow_fs = true
}
}

resource "nomad_job" "fastcgi_green" {
provider = nomad.green
depends_on = [
Expand All @@ -68,19 +46,6 @@ resource "nomad_job" "fastcgi_green" {
}
}

resource "nomad_job" "http" {
depends_on = [
nomad_csi_volume_registration.caddycerts,
]

jobspec = file("../jobs/http.nomad")
detach = false

hcl2 {
allow_fs = true
}
}

resource "nomad_job" "http_green" {
provider = nomad.green
# TODO Replace EBS CSI with S3 CSI or something
Expand Down
32 changes: 0 additions & 32 deletions terraform/volumes.tf
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
resource "nomad_job" "plugin-ebs-controller" {
jobspec = file("../jobs/plugin-ebs-controller.nomad")

hcl2 {
allow_fs = true
}
}

resource "nomad_job" "plugin-ebs-nodes" {
jobspec = file("../jobs/plugin-ebs-nodes.nomad")

hcl2 {
allow_fs = true
}
}

resource "nomad_job" "plugin_ebs_controller_green" {
provider = nomad.green
jobspec = file("../jobs/plugin-ebs-controller.nomad")
Expand Down Expand Up @@ -45,22 +29,6 @@ resource "nomad_csi_volume_registration" "mysql_green" {
}
}

import {
id = "caddycerts@default"
to = nomad_csi_volume_registration.caddycerts
}
resource "nomad_csi_volume_registration" "caddycerts" {
plugin_id = "aws-ebs0"
volume_id = "caddycerts"
name = "caddycerts"
external_id = data.terraform_remote_state.aws.outputs.ebs_caddycerts_id

capability {
access_mode = "single-node-writer"
attachment_mode = "file-system"
}
}

resource "nomad_csi_volume_registration" "caddycerts_green" {
provider = nomad.green
plugin_id = "aws-ebs0"
Expand Down

0 comments on commit 83a6957

Please sign in to comment.