Skip to content

Commit

Permalink
More cleanup of overcomplicated/outdated infra
Browse files Browse the repository at this point in the history
  • Loading branch information
stwalkerster committed Jan 12, 2025
1 parent 5568c34 commit c0f0940
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 26 deletions.
7 changes: 3 additions & 4 deletions dns.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,18 @@ resource "openstack_dns_recordset_v2" "prod_db" {
}

locals {
proxy_hostname = "${var.resource_prefix}${var.proxy_suffix}"
staging_proxy_hostname = "${local.proxy_hostname}-staging"
proxy_hostname = var.resource_prefix
}

resource "cloudvps_web_proxy" "application_proxy" {
hostname = local.proxy_hostname
domain = var.proxy_domain
backends = ["http://app-prod.${trimsuffix(data.openstack_dns_zone_v2.rootzone.name, ".")}:80"]
backends = ["http://${local.production_app_instance_ip4}:80"]
}

resource "cloudvps_web_proxy" "application_proxy_dev" {
hostname = "${local.proxy_hostname}-dev"
domain = var.proxy_domain
backends = ["http://app-prod.${trimsuffix(data.openstack_dns_zone_v2.rootzone.name, ".")}:80"]
backends = ["http://${local.production_app_instance_ip4}:80"]
}

17 changes: 0 additions & 17 deletions legacy-appserver.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ resource "openstack_dns_recordset_v2" "legacy_prod_app6" {
ttl = 900
}


import {
id = "9d7288ae-ad02-40a6-8976-495d63c040a0"
to = openstack_compute_instance_v2.legacy_app6
}

resource "openstack_compute_instance_v2" "legacy_app6" {
name = "${var.resource_prefix}-appserver6"
image_id = data.openstack_images_image_v2.legacy_image.id
Expand Down Expand Up @@ -43,29 +37,18 @@ resource "openstack_compute_instance_v2" "legacy_app6" {
}
}

import {
id = "0bdf4b46-49a4-4eb4-8966-7eb6d2fdec90"
to = openstack_blockstorage_volume_v3.legacy_app6
}

resource "openstack_blockstorage_volume_v3" "legacy_app6" {
name = "app-www"
# description = "Application files; managed by Terraform"
size = 5
}

import {
id = "9d7288ae-ad02-40a6-8976-495d63c040a0/0bdf4b46-49a4-4eb4-8966-7eb6d2fdec90"
to = openstack_compute_volume_attach_v2.legacy_app6
}

resource "openstack_compute_volume_attach_v2" "legacy_app6" {
instance_id = openstack_compute_instance_v2.legacy_app6.id
volume_id = openstack_blockstorage_volume_v3.legacy_app6.id
device = "/dev/sdb"
}


data "openstack_networking_secgroup_v2" "legacy_web" {
name = "web"
}
4 changes: 4 additions & 0 deletions switches.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
locals {
production_app_instance_ip4 = openstack_compute_instance_v2.legacy_app6.access_ip_v4
production_db_instance_ip4 = openstack_compute_instance_v2.legacy_db7.access_ip_v4
}
5 changes: 0 additions & 5 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ variable "proxy_domain" {
default = "wmcloud.org"
}

variable "proxy_suffix" {
default = ""
type = string
}

# DNS zone
variable "dns_zone" {
type = string
Expand Down

0 comments on commit c0f0940

Please sign in to comment.