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 630c487
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 81 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
12 changes: 0 additions & 12 deletions terraform/base.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
variable "nomad_token" {
type = string
sensitive = true
}

variable "nomad_green_token" {
type = string
sensitive = true
Expand Down Expand Up @@ -42,13 +37,6 @@ data "terraform_remote_state" "aws" {
}
}

provider "nomad" {
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
region = "global"
}

provider "nomad" {
alias = "green"
address = "http://${data.terraform_remote_state.aws.outputs.nomad_green_public_ip}:4646"
Expand Down
37 changes: 1 addition & 36 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,23 +28,10 @@ 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 = [
nomad_job.memcached,
nomad_job.memcached_green,
]

jobspec = file("../jobs/fastcgi.nomad")
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 630c487

Please sign in to comment.