Commit 6fec5d54 authored by John Jarvis's avatar John Jarvis

Add storage servers, remove addresses that are not needed.

parent 3753244a
......@@ -14,9 +14,9 @@ variable "gitlab_net_zone_id" {}
## Google
provider "google" {
# credentials = "${file("../../private/google-credentials/${var.environment}.json")}"
project = "${var.project}"
region = "${var.region}"
credentials = "${file("../../private/google-credentials/${var.environment}.json")}"
project = "${var.project}"
region = "${var.region}"
}
##################################
......@@ -292,6 +292,7 @@ module "file" {
source = "../../modules/google/generic-pet"
tier = "stor"
vpc = "${module.network.self_link}"
zone = "us-east1-c"
}
##################################
......
......@@ -83,7 +83,7 @@ variable "node_count" {
"redis" = 1
"redis-cache" = 1
"sidekiq-besteffort" = 1
"stor" = 1
"stor" = 12
"web" = 1
"lfs" = 1
"pages" = 1
......
resource "google_compute_address" "static-ip-address" {
name = "${format("%v-%02d-%v-%v-static-ip", var.name, count.index + 1, var.tier, var.environment)}"
address_type = "INTERNAL"
// address = "${replace(var.ip_cidr_range, "/\\d+\\/\\d+$/", count.index + 2)}"
subnetwork = "${google_compute_subnetwork.subnetwork.self_link}"
}
resource "google_compute_disk" "data_disk" {
project = "${var.project}"
count = "${(var.attach_data_disk && var.node_count > 0) ? var.node_count : 0}"
name = "${format("%v-%02d-%v-%v-data", var.name, count.index + 1, var.tier, var.environment)}"
zone = "${data.google_compute_zones.available.names[(count.index + 1) % length(data.google_compute_zones.available.names)]}"
zone = "${var.zone != "" ? var.zone : data.google_compute_zones.available.names[(count.index + 1) % length(data.google_compute_zones.available.names)]}"
size = "${var.data_disk_size}"
type = "${var.data_disk_type}"
......@@ -37,7 +29,7 @@ resource "google_compute_instance" "instance_with_attached_disk" {
metadata_startup_script = "${file("${path.module}/../../../scripts/google/generic-pet-bootstrap.sh")}"
project = "${var.project}"
zone = "${data.google_compute_zones.available.names[(count.index + 1) % length(data.google_compute_zones.available.names)]}"
zone = "${var.zone != "" ? var.zone : data.google_compute_zones.available.names[(count.index + 1) % length(data.google_compute_zones.available.names)]}"
service_account {
// this should be the instance under which the instance should be running, rather than the one creating it...
......@@ -78,7 +70,6 @@ resource "google_compute_instance" "instance_with_attached_disk" {
network_interface {
subnetwork = "${google_compute_subnetwork.subnetwork.name}"
address = "${google_compute_address.static-ip-address.address}"
access_config = {}
}
......@@ -115,7 +106,7 @@ resource "google_compute_instance" "instance_without_attached_disk" {
metadata_startup_script = "${file("${path.module}/../../../scripts/google/generic-pet-bootstrap.sh")}"
project = "${var.project}"
zone = "${data.google_compute_zones.available.names[(count.index + 1) % length(data.google_compute_zones.available.names)]}"
zone = "${var.zone != "" ? var.zone : data.google_compute_zones.available.names[(count.index + 1) % length(data.google_compute_zones.available.names)]}"
service_account {
// this should be the instance under which the instance should be running, rather than the one creating it...
......@@ -152,7 +143,6 @@ resource "google_compute_instance" "instance_without_attached_disk" {
network_interface {
subnetwork = "${google_compute_subnetwork.subnetwork.name}"
address = "${google_compute_address.static-ip-address.address}"
access_config = {}
}
......
......@@ -105,3 +105,8 @@ variable "vpc" {
type = "string"
description = "The target network"
}
variable "zone" {
type = "string"
default = ""
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment