use former Pyrmont hosts as first 2 cortex.test hosts

https://github.com/status-im/infra-codex/issues/1

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2022-03-31 19:39:17 +02:00
parent 53710b0716
commit 2cc52367f2
No known key found for this signature in database
GPG Key ID: 09AA5403E54D9931
3 changed files with 63 additions and 0 deletions

18
ansible/inventory/test Normal file
View File

@ -0,0 +1,18 @@
# NOTE: This file is generated by terraform.py
# For emergency use when Consul fails
[all]
metal-01.he-eu-hel1.codex.test hostname=metal-01.he-eu-hel1.codex.test ansible_host=65.21.196.45 env=codex stage=test data_center=he-eu-hel1 region=eu-hel1 dns_entry=metal-01.he-eu-hel1.codex.test.statusim.net
metal-02.he-eu-hel1.codex.test hostname=metal-02.he-eu-hel1.codex.test ansible_host=65.21.196.46 env=codex stage=test data_center=he-eu-hel1 region=eu-hel1 dns_entry=metal-02.he-eu-hel1.codex.test.statusim.net
[codex-test]
metal-01.he-eu-hel1.codex.test
metal-02.he-eu-hel1.codex.test
[codex.test]
metal-01.he-eu-hel1.codex.test
metal-02.he-eu-hel1.codex.test
[he-eu-hel1]
metal-01.he-eu-hel1.codex.test
metal-02.he-eu-hel1.codex.test

17
nodes.tf Normal file
View File

@ -0,0 +1,17 @@
/* Hetzner AX41-NVMe
* AMD Ryzen 5 3600 Hexa-Core
* 64 GB DDR4 RAM
* 2 x 512 GB NVMe SSD */
module "codex" {
source = "./modules/dummy-module"
name = "metal"
env = local.ws.env
stage = local.ws.stage
group = "${local.ws.env}-${local.ws.stage}"
region = "eu-hel1"
prefix = "he"
domain = var.domain
ips = local.ws.hosts
}

28
workspaces.tf Normal file
View File

@ -0,0 +1,28 @@
/**
* This is a hacky way of binding specific variable
* values to different Terraform workspaces.
*
* Details:
* https://github.com/hashicorp/terraform/issues/15966
*/
locals {
env = {
defaults = {
env = "codex"
stage = terraform.workspace
}
# Inherits defaults.
test = {
hosts = [
"65.21.196.45", # metal-01.he-eu-hel1.codex.test
"65.21.196.46", # metal-02.he-eu-hel1.codex.test
]
}
}
}
locals {
ws = merge(local.env["defaults"], local.env[terraform.workspace])
}