Skip to content

Commit

Permalink
ops: staging back online
Browse files Browse the repository at this point in the history
  • Loading branch information
dd84ai committed Mar 3, 2024
1 parent 2a6cd5f commit 9885b5f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 27 deletions.
3 changes: 0 additions & 3 deletions infra/tf/production/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ module "stack" {
datacenter = "ash-dc1"
}

output "cluster_ip" {
value = module.stack.cluster_ip
}

data "aws_ssm_parameter" "darkbot" {
name = "/terraform/hetzner/darkbot/production"
Expand Down
40 changes: 17 additions & 23 deletions infra/tf/staging/main.tf
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
# module "stack" {
# source = "../modules/hetzner_server"
# environment = "staging"
# server_power = "cpx21"
# backups = false
# }

# output "cluster_ip" {
# value = module.stack.cluster_ip
# }

# provider "docker" {
# host = "ssh://root@${module.stack.cluster_ip}:22"
# ssh_opts = ["-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", "-i", "~/.ssh/id_rsa.darklab"]
# }
module "server" {
source = "../../../../infra/tf/modules/hetzner_server/data"
name = "node-arm"
}

data "aws_ssm_parameter" "darkbot" {
name = "/terraform/hetzner/darkbot/staging"
Expand All @@ -22,11 +11,16 @@ locals {
secrets = nonsensitive(jsondecode(data.aws_ssm_parameter.darkbot.value))
}

# module "darkbot" {
# source = "../modules/darkbot"
# configurator_dbname = "staging"
# consoler_prefix = ","
# secrets = local.secrets
# tag_version = "v1.5.0"
# debug = false
# }
provider "docker" {
host = "ssh://root@${module.server.ipv4_address}:22"
ssh_opts = ["-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", "-i", "~/.ssh/id_rsa.darklab"]
}

module "darkbot" {
source = "../modules/darkbot"
configurator_dbname = "staging"
consoler_prefix = ","
secrets = local.secrets
tag_version = "v1.5.1-arm"
debug = false
}
5 changes: 4 additions & 1 deletion infra/tf/staging/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ terraform {
}
}

data "aws_ssm_parameter" "hetzner" {
name = "/terraform/hetzner/production"
}
provider "hcloud" {
token = local.secrets["HETZNER_TOKEN"]
token = data.aws_ssm_parameter.hetzner.value
}

data "aws_ssm_parameter" "cloudflare_key" {
Expand Down

0 comments on commit 9885b5f

Please sign in to comment.