Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup #14

Merged
merged 2 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module "application-blue" {
source = "github.com/enwikipedia-acc/terraform-openstack-waca-application?ref=0.1.0"

count = 1
count = 0

dns_name = "${var.resource_prefix}-appserver-b.${data.openstack_dns_zone_v2.rootzone.name}"
resource_prefix = "${var.resource_prefix}-appserver-b"
Expand Down
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
Loading