Merge pull request 'feature/26281' (#17) from feature/26281 into main

Reviewed-on: #17
This commit is contained in:
Giancarlo Panichi 2023-12-18 15:57:05 +01:00
commit 03297ed835
3 changed files with 233 additions and 0 deletions

View File

@ -0,0 +1,227 @@
# Define required providers
terraform {
required_version = ">= 0.14.0"
required_providers {
openstack = {
source = "terraform-provider-openstack/openstack"
version = "~> 1.53.0"
}
}
}
data "terraform_remote_state" "privnet_dns_router" {
backend = "local"
config = {
path = "../project-setup/terraform.tfstate"
}
}
#
# Uses common_variables as module
#
module "common_variables" {
source = "../../modules/common_variables"
}
module "instance_with_data_volume" {
source = "../../modules/instance_with_data_volume"
instances_with_data_volume_map = {
dm_pool_manager_proto = {
name = "dm-pool-manager-proto",
description = "This instance is a DataMiner Pool Manager service",
flavor = module.common_variables.flavor_list.m1_large,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
security_groups = [data.terraform_remote_state.privnet_dns_router.outputs.default_security_group_name, data.terraform_remote_state.privnet_dns_router.outputs.security_group_list.http_and_https_from_the_load_balancers],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dm_pool_manager_proto_data_volume",
size = "30",
device = "/dev/vdb"
}
},
dataminer_proto_ghost = {
name = "dataminer-proto-ghost",
description = "This instance is a DataMiner Ghost service",
flavor = module.common_variables.flavor_list.m1_large,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
security_groups = [data.terraform_remote_state.privnet_dns_router.outputs.default_security_group_name, data.terraform_remote_state.privnet_dns_router.outputs.security_group_list.http_and_https_from_the_load_balancers],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_proto_ghost_data_volume",
size = "50",
device = "/dev/vdb"
}
},
dataminer_1_proto_1804 = {
name = "dataminer1-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.m1_xxl,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
security_groups = [data.terraform_remote_state.privnet_dns_router.outputs.default_security_group_name, data.terraform_remote_state.privnet_dns_router.outputs.security_group_list.http_and_https_from_the_load_balancers],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_1_proto_1804_data_volume",
size = "80",
device = "/dev/vdb"
}
},
dataminer_2_proto_1804 = {
name = "dataminer2-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.m1_xxl,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
security_groups = [data.terraform_remote_state.privnet_dns_router.outputs.default_security_group_name, data.terraform_remote_state.privnet_dns_router.outputs.security_group_list.http_and_https_from_the_load_balancers],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_2_proto_1804_data_volume",
size = "80",
device = "/dev/vdb"
}
},
dataminer_3_proto_1804 = {
name = "dataminer3-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.m1_xxl,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
security_groups = [data.terraform_remote_state.privnet_dns_router.outputs.default_security_group_name, data.terraform_remote_state.privnet_dns_router.outputs.security_group_list.http_and_https_from_the_load_balancers],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_3_proto_1804_data_volume",
size = "80",
device = "/dev/vdb"
}
},
dataminer_4_proto_1804 = {
name = "dataminer4-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.m1_xxl,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
security_groups = [data.terraform_remote_state.privnet_dns_router.outputs.default_security_group_name, data.terraform_remote_state.privnet_dns_router.outputs.security_group_list.http_and_https_from_the_load_balancers],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_4_proto_1804_data_volume",
size = "80",
device = "/dev/vdb"
}
},
dataminer_5_proto_1804 = {
name = "dataminer5-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.m1_xxl,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
security_groups = [data.terraform_remote_state.privnet_dns_router.outputs.default_security_group_name, data.terraform_remote_state.privnet_dns_router.outputs.security_group_list.http_and_https_from_the_load_balancers],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_5_proto_1804_data_volume",
size = "80",
device = "/dev/vdb"
}
},
dataminer_6_proto_1804 = {
name = "dataminer6-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.m1_xxl,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
security_groups = [data.terraform_remote_state.privnet_dns_router.outputs.default_security_group_name, data.terraform_remote_state.privnet_dns_router.outputs.security_group_list.http_and_https_from_the_load_balancers],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_6_proto_1804_data_volume",
size = "80",
device = "/dev/vdb"
}
},
dataminer_7_proto_1804 = {
name = "dataminer7-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.m1_xxl,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
security_groups = [data.terraform_remote_state.privnet_dns_router.outputs.default_security_group_name, data.terraform_remote_state.privnet_dns_router.outputs.security_group_list.http_and_https_from_the_load_balancers],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_7_proto_1804_data_volume",
size = "80",
device = "/dev/vdb"
}
},
dataminer_8_proto_1804 = {
name = "dataminer8-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.m1_xxl,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
security_groups = [data.terraform_remote_state.privnet_dns_router.outputs.default_security_group_name, data.terraform_remote_state.privnet_dns_router.outputs.security_group_list.http_and_https_from_the_load_balancers],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_8_proto_1804_data_volume",
size = "80",
device = "/dev/vdb"
}
},
dataminer_2_gw_proto_1804 = {
name = "dataminer2-gw-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.c2_large,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
security_groups = [data.terraform_remote_state.privnet_dns_router.outputs.default_security_group_name, data.terraform_remote_state.privnet_dns_router.outputs.security_group_list.http_and_https_from_the_load_balancers],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_2_gw_proto_1804_data_volume",
size = "40",
device = "/dev/vdb"
}
},
dataminer_3_gw_proto_1804 = {
name = "dataminer3-gw-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.c2_large,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
security_groups = [data.terraform_remote_state.privnet_dns_router.outputs.default_security_group_name, data.terraform_remote_state.privnet_dns_router.outputs.security_group_list.http_and_https_from_the_load_balancers],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_3_gw_proto_1804_data_volume",
size = "40",
device = "/dev/vdb"
}
},
dataminer_4_gw_proto_1804 = {
name = "dataminer4-gw-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.c2_large,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
security_groups = [data.terraform_remote_state.privnet_dns_router.outputs.default_security_group_name, data.terraform_remote_state.privnet_dns_router.outputs.security_group_list.http_and_https_from_the_load_balancers],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_4_gw_proto_1804_data_volume",
size = "40",
device = "/dev/vdb"
}
},
dataminer_5_gw_proto_1804 = {
name = "dataminer5-gw-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.c2_large,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
security_groups = [data.terraform_remote_state.privnet_dns_router.outputs.default_security_group_name, data.terraform_remote_state.privnet_dns_router.outputs.security_group_list.http_and_https_from_the_load_balancers],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_5_gw_proto_1804_data_volume",
size = "40",
device = "/dev/vdb"
}
}
}
}

View File

@ -0,0 +1,3 @@
provider "openstack" {
cloud = "d4s-production"
}

View File

@ -186,12 +186,15 @@ variable "flavor_list" {
c1_small = "c1.small" #RAM 2 - VCPUs 2
c1_medium = "c1.medium" #RAM 4 - VCPUs 4
c1_large = "c1.large" #RAM 8 - VCPUs 8
c2_large = "c2.large" #RAM 16 -VCPUs 16
m1_medium = "m1.medium" #RAM 4 - VCPUs 2
m1_large = "m1.large" #RAM 8 - VCPUs 4
m1_xlarge = "m1.xlarge" #RAM 16 - VCPUs 8
m1_xxl = "m1.xxl" #RAM 32 - VCPUS 16
m2_small = "m2.small" #RAM 8 - VCPUs 2
m2_medium = "m2.medium" #RAM 16 - VCPUs 4
m2_large = "m2.large" #RAM 32 - VCPUs 8
m3_large = "m3.large" #RAM 64 - VCPUs 16
}
}