From 8350b51931e8ff4215685ab708c709f8ec4e0694 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 17 Nov 2023 16:50:33 +0100 Subject: [PATCH] Another cleanup. Add the mongodb module. --- .../00-terraform-provider.tf | 1 - .../basic-infrastructure/00-variables.tf | 1 - .../01-external-network-and-resolvers.tf | 1 - .../05-projects-and-users-vars.tf | 1 - .../basic-infrastructure/docker-swarm.tf | 2 +- .../d4s-dev/basic-infrastructure/main.tf | 26 + .../basic-infrastructure/swarm-variables.tf | 2 +- .../basic-infrastructure/variables-dev.tf | 1 + .../d4s-dev/basic-infrastructure/variables.tf | 1 + openstack-tf/d4s-dev/orientdb/00-variables.tf | 1 - .../external-network-and-resolvers.tf | 1 - .../orientdb/projects-and-users-vars.tf | 1 - ...-provider-configuration.tf => provider.tf} | 0 .../d4s-dev/orientdb/variables-dev.tf | 1 + openstack-tf/d4s-dev/orientdb/variables.tf | 1 + .../{00-provider-configuration.tf => main.tf} | 5 +- .../d4s-dev/project-setup/network-setup.tf | 4 - .../d4s-dev/project-setup/provider.tf | 5 + .../timescaledb/00-provider-configuration.tf | 4 + openstack-tf/d4s-dev/timescaledb/main.tf | 26 + openstack-tf/d4s-dev/timescaledb/outputs.tf | 1 + .../d4s-dev/timescaledb/variables-dev.tf | 1 + openstack-tf/d4s-dev/timescaledb/variables.tf | 1 + .../{00-variables.tf => variables-dev.tf} | 62 +- .../00-terraform-provider.tf | 1 - .../basic-infrastructure/00-variables.tf | 1 - .../01-external-network-and-resolvers.tf | 1 - .../05-projects-and-users-vars.tf | 1 - .../basic-infrastructure/docker-swarm.tf | 2 +- .../basic-infrastructure/provider.tf | 11 + .../basic-infrastructure/swarm-variables.tf | 2 +- .../variables-production.tf | 1 + .../basic-infrastructure/variables.tf | 1 + .../mongodb/.terraform.lock.hcl | 24 + openstack-tf/d4s-production/mongodb/main.tf | 26 + .../mongodb/mongodb.auto.tfvars | 20 + .../d4s-production/mongodb/mongodb.tf | 1 + .../d4s-production/mongodb/provider.tf | 3 + .../d4s-production/mongodb/terraform.tfstate | 1234 +++++++++++++++++ .../mongodb/variables-mongodb.tf | 1 + .../mongodb/variables-production.tf | 1 + .../d4s-production/mongodb/variables.tf | 1 + .../project-setup/00-terraform-provider.tf | 1 - .../project-setup/00-variables.tf | 1 - .../01-external-network-and-resolvers.tf | 1 - .../project-setup/setup-provider.tf | 11 + .../project-setup/variables-production.tf | 1 + .../d4s-production/project-setup/variables.tf | 1 + ...0-variables.tf => variables-production.tf} | 7 +- .../external-network-and-resolvers.tf | 50 - .../{ => modules}/common_variables/outputs.tf | 0 .../projects-and-users-vars.tf | 52 - .../common_variables/variables.tf | 12 + .../docker_swarm}/docker-swarm.tf | 0 .../docker_swarm}/swarm-variables.tf | 0 openstack-tf/modules/mongodb/mongodb.tf | 185 +++ .../modules/mongodb/variables-mongodb.tf | 32 + openstack-tf/modules/orientdb/orientdb.tf | 8 +- .../modules/timescaledb/timescaledb.tf | 93 ++ .../timescaledb/variables-timescaledb.tf | 37 + 60 files changed, 1794 insertions(+), 180 deletions(-) delete mode 120000 openstack-tf/d4s-dev/basic-infrastructure/00-terraform-provider.tf delete mode 120000 openstack-tf/d4s-dev/basic-infrastructure/00-variables.tf delete mode 120000 openstack-tf/d4s-dev/basic-infrastructure/01-external-network-and-resolvers.tf delete mode 120000 openstack-tf/d4s-dev/basic-infrastructure/05-projects-and-users-vars.tf create mode 100644 openstack-tf/d4s-dev/basic-infrastructure/main.tf create mode 120000 openstack-tf/d4s-dev/basic-infrastructure/variables-dev.tf create mode 120000 openstack-tf/d4s-dev/basic-infrastructure/variables.tf delete mode 120000 openstack-tf/d4s-dev/orientdb/00-variables.tf delete mode 120000 openstack-tf/d4s-dev/orientdb/external-network-and-resolvers.tf delete mode 120000 openstack-tf/d4s-dev/orientdb/projects-and-users-vars.tf rename openstack-tf/d4s-dev/orientdb/{00-provider-configuration.tf => provider.tf} (100%) create mode 120000 openstack-tf/d4s-dev/orientdb/variables-dev.tf create mode 120000 openstack-tf/d4s-dev/orientdb/variables.tf rename openstack-tf/d4s-dev/project-setup/{00-provider-configuration.tf => main.tf} (72%) delete mode 100644 openstack-tf/d4s-dev/project-setup/network-setup.tf create mode 100644 openstack-tf/d4s-dev/project-setup/provider.tf create mode 100644 openstack-tf/d4s-dev/timescaledb/00-provider-configuration.tf create mode 100644 openstack-tf/d4s-dev/timescaledb/main.tf create mode 120000 openstack-tf/d4s-dev/timescaledb/outputs.tf create mode 120000 openstack-tf/d4s-dev/timescaledb/variables-dev.tf create mode 120000 openstack-tf/d4s-dev/timescaledb/variables.tf rename openstack-tf/d4s-dev/variables/{00-variables.tf => variables-dev.tf} (78%) delete mode 120000 openstack-tf/d4s-production/basic-infrastructure/00-terraform-provider.tf delete mode 120000 openstack-tf/d4s-production/basic-infrastructure/00-variables.tf delete mode 120000 openstack-tf/d4s-production/basic-infrastructure/01-external-network-and-resolvers.tf delete mode 120000 openstack-tf/d4s-production/basic-infrastructure/05-projects-and-users-vars.tf create mode 120000 openstack-tf/d4s-production/basic-infrastructure/variables-production.tf create mode 120000 openstack-tf/d4s-production/basic-infrastructure/variables.tf create mode 100644 openstack-tf/d4s-production/mongodb/.terraform.lock.hcl create mode 100644 openstack-tf/d4s-production/mongodb/main.tf create mode 100644 openstack-tf/d4s-production/mongodb/mongodb.auto.tfvars create mode 120000 openstack-tf/d4s-production/mongodb/mongodb.tf create mode 100644 openstack-tf/d4s-production/mongodb/provider.tf create mode 100644 openstack-tf/d4s-production/mongodb/terraform.tfstate create mode 120000 openstack-tf/d4s-production/mongodb/variables-mongodb.tf create mode 120000 openstack-tf/d4s-production/mongodb/variables-production.tf create mode 120000 openstack-tf/d4s-production/mongodb/variables.tf delete mode 120000 openstack-tf/d4s-production/project-setup/00-terraform-provider.tf delete mode 120000 openstack-tf/d4s-production/project-setup/00-variables.tf delete mode 120000 openstack-tf/d4s-production/project-setup/01-external-network-and-resolvers.tf create mode 120000 openstack-tf/d4s-production/project-setup/variables-production.tf create mode 120000 openstack-tf/d4s-production/project-setup/variables.tf rename openstack-tf/d4s-production/variables/{00-variables.tf => variables-production.tf} (93%) delete mode 100644 openstack-tf/modules/common_variables/external-network-and-resolvers.tf rename openstack-tf/{ => modules}/common_variables/outputs.tf (100%) delete mode 100644 openstack-tf/modules/common_variables/projects-and-users-vars.tf rename openstack-tf/{ => modules}/common_variables/variables.tf (92%) rename openstack-tf/{docker_swarm_setup => modules/docker_swarm}/docker-swarm.tf (100%) rename openstack-tf/{docker_swarm_setup => modules/docker_swarm}/swarm-variables.tf (100%) create mode 100644 openstack-tf/modules/mongodb/mongodb.tf create mode 100644 openstack-tf/modules/mongodb/variables-mongodb.tf create mode 100644 openstack-tf/modules/timescaledb/timescaledb.tf create mode 100644 openstack-tf/modules/timescaledb/variables-timescaledb.tf diff --git a/openstack-tf/d4s-dev/basic-infrastructure/00-terraform-provider.tf b/openstack-tf/d4s-dev/basic-infrastructure/00-terraform-provider.tf deleted file mode 120000 index c094d201..00000000 --- a/openstack-tf/d4s-dev/basic-infrastructure/00-terraform-provider.tf +++ /dev/null @@ -1 +0,0 @@ -../../common_variables/00-terraform-provider.tf \ No newline at end of file diff --git a/openstack-tf/d4s-dev/basic-infrastructure/00-variables.tf b/openstack-tf/d4s-dev/basic-infrastructure/00-variables.tf deleted file mode 120000 index df2af105..00000000 --- a/openstack-tf/d4s-dev/basic-infrastructure/00-variables.tf +++ /dev/null @@ -1 +0,0 @@ -../variables/00-variables.tf \ No newline at end of file diff --git a/openstack-tf/d4s-dev/basic-infrastructure/01-external-network-and-resolvers.tf b/openstack-tf/d4s-dev/basic-infrastructure/01-external-network-and-resolvers.tf deleted file mode 120000 index c53c78ad..00000000 --- a/openstack-tf/d4s-dev/basic-infrastructure/01-external-network-and-resolvers.tf +++ /dev/null @@ -1 +0,0 @@ -../../common_variables/01-external-network-and-resolvers.tf \ No newline at end of file diff --git a/openstack-tf/d4s-dev/basic-infrastructure/05-projects-and-users-vars.tf b/openstack-tf/d4s-dev/basic-infrastructure/05-projects-and-users-vars.tf deleted file mode 120000 index 22fce1fb..00000000 --- a/openstack-tf/d4s-dev/basic-infrastructure/05-projects-and-users-vars.tf +++ /dev/null @@ -1 +0,0 @@ -../../common_variables/05-projects-and-users-vars.tf \ No newline at end of file diff --git a/openstack-tf/d4s-dev/basic-infrastructure/docker-swarm.tf b/openstack-tf/d4s-dev/basic-infrastructure/docker-swarm.tf index f15e8235..afb0c71c 120000 --- a/openstack-tf/d4s-dev/basic-infrastructure/docker-swarm.tf +++ b/openstack-tf/d4s-dev/basic-infrastructure/docker-swarm.tf @@ -1 +1 @@ -../../docker_swarm_setup/docker-swarm.tf \ No newline at end of file +../../modules/docker_swarm/docker-swarm.tf \ No newline at end of file diff --git a/openstack-tf/d4s-dev/basic-infrastructure/main.tf b/openstack-tf/d4s-dev/basic-infrastructure/main.tf new file mode 100644 index 00000000..840de8b8 --- /dev/null +++ b/openstack-tf/d4s-dev/basic-infrastructure/main.tf @@ -0,0 +1,26 @@ +# 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" + } +} + +# module "variables" { +# source = "../variables" +# } + +# module "basic_setup" { +# source = "../../modules/basic_setup" +# } diff --git a/openstack-tf/d4s-dev/basic-infrastructure/swarm-variables.tf b/openstack-tf/d4s-dev/basic-infrastructure/swarm-variables.tf index 150f70a9..77642fe4 120000 --- a/openstack-tf/d4s-dev/basic-infrastructure/swarm-variables.tf +++ b/openstack-tf/d4s-dev/basic-infrastructure/swarm-variables.tf @@ -1 +1 @@ -../../docker_swarm_setup/swarm-variables.tf \ No newline at end of file +../../modules/docker_swarm/swarm-variables.tf \ No newline at end of file diff --git a/openstack-tf/d4s-dev/basic-infrastructure/variables-dev.tf b/openstack-tf/d4s-dev/basic-infrastructure/variables-dev.tf new file mode 120000 index 00000000..fde4869e --- /dev/null +++ b/openstack-tf/d4s-dev/basic-infrastructure/variables-dev.tf @@ -0,0 +1 @@ +../variables/variables-dev.tf \ No newline at end of file diff --git a/openstack-tf/d4s-dev/basic-infrastructure/variables.tf b/openstack-tf/d4s-dev/basic-infrastructure/variables.tf new file mode 120000 index 00000000..be9f7878 --- /dev/null +++ b/openstack-tf/d4s-dev/basic-infrastructure/variables.tf @@ -0,0 +1 @@ +../../modules/common_variables/variables.tf \ No newline at end of file diff --git a/openstack-tf/d4s-dev/orientdb/00-variables.tf b/openstack-tf/d4s-dev/orientdb/00-variables.tf deleted file mode 120000 index df2af105..00000000 --- a/openstack-tf/d4s-dev/orientdb/00-variables.tf +++ /dev/null @@ -1 +0,0 @@ -../variables/00-variables.tf \ No newline at end of file diff --git a/openstack-tf/d4s-dev/orientdb/external-network-and-resolvers.tf b/openstack-tf/d4s-dev/orientdb/external-network-and-resolvers.tf deleted file mode 120000 index 5918f321..00000000 --- a/openstack-tf/d4s-dev/orientdb/external-network-and-resolvers.tf +++ /dev/null @@ -1 +0,0 @@ -../../modules/common_variables/external-network-and-resolvers.tf \ No newline at end of file diff --git a/openstack-tf/d4s-dev/orientdb/projects-and-users-vars.tf b/openstack-tf/d4s-dev/orientdb/projects-and-users-vars.tf deleted file mode 120000 index 38d9ca9a..00000000 --- a/openstack-tf/d4s-dev/orientdb/projects-and-users-vars.tf +++ /dev/null @@ -1 +0,0 @@ -../../modules/common_variables/projects-and-users-vars.tf \ No newline at end of file diff --git a/openstack-tf/d4s-dev/orientdb/00-provider-configuration.tf b/openstack-tf/d4s-dev/orientdb/provider.tf similarity index 100% rename from openstack-tf/d4s-dev/orientdb/00-provider-configuration.tf rename to openstack-tf/d4s-dev/orientdb/provider.tf diff --git a/openstack-tf/d4s-dev/orientdb/variables-dev.tf b/openstack-tf/d4s-dev/orientdb/variables-dev.tf new file mode 120000 index 00000000..fde4869e --- /dev/null +++ b/openstack-tf/d4s-dev/orientdb/variables-dev.tf @@ -0,0 +1 @@ +../variables/variables-dev.tf \ No newline at end of file diff --git a/openstack-tf/d4s-dev/orientdb/variables.tf b/openstack-tf/d4s-dev/orientdb/variables.tf new file mode 120000 index 00000000..be9f7878 --- /dev/null +++ b/openstack-tf/d4s-dev/orientdb/variables.tf @@ -0,0 +1 @@ +../../modules/common_variables/variables.tf \ No newline at end of file diff --git a/openstack-tf/d4s-dev/project-setup/00-provider-configuration.tf b/openstack-tf/d4s-dev/project-setup/main.tf similarity index 72% rename from openstack-tf/d4s-dev/project-setup/00-provider-configuration.tf rename to openstack-tf/d4s-dev/project-setup/main.tf index d91da117..301b3c95 100644 --- a/openstack-tf/d4s-dev/project-setup/00-provider-configuration.tf +++ b/openstack-tf/d4s-dev/project-setup/main.tf @@ -9,8 +9,7 @@ required_version = ">= 0.14.0" } } -provider "openstack" { - cloud = "d4s-dev" -# cloud = "ISTI-Cloud" +module "main-network" { + source = "../../modules/main_private_net_and_dns_zone" } diff --git a/openstack-tf/d4s-dev/project-setup/network-setup.tf b/openstack-tf/d4s-dev/project-setup/network-setup.tf deleted file mode 100644 index 5fb7e064..00000000 --- a/openstack-tf/d4s-dev/project-setup/network-setup.tf +++ /dev/null @@ -1,4 +0,0 @@ -module "main-network" { - source = "../../modules/main_private_net_and_dns_zone" -} - diff --git a/openstack-tf/d4s-dev/project-setup/provider.tf b/openstack-tf/d4s-dev/project-setup/provider.tf new file mode 100644 index 00000000..84c1a5e6 --- /dev/null +++ b/openstack-tf/d4s-dev/project-setup/provider.tf @@ -0,0 +1,5 @@ +provider "openstack" { + cloud = "d4s-dev" +# cloud = "ISTI-Cloud" +} + diff --git a/openstack-tf/d4s-dev/timescaledb/00-provider-configuration.tf b/openstack-tf/d4s-dev/timescaledb/00-provider-configuration.tf new file mode 100644 index 00000000..df431972 --- /dev/null +++ b/openstack-tf/d4s-dev/timescaledb/00-provider-configuration.tf @@ -0,0 +1,4 @@ +provider "openstack" { + cloud = "d4s-dev" +} + diff --git a/openstack-tf/d4s-dev/timescaledb/main.tf b/openstack-tf/d4s-dev/timescaledb/main.tf new file mode 100644 index 00000000..da195268 --- /dev/null +++ b/openstack-tf/d4s-dev/timescaledb/main.tf @@ -0,0 +1,26 @@ +# 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" + } +} + +# module "variables" { +# source = "../variables" +# } + +# module "orientdb" { +# source = "../../modules/timescaledb" +# } diff --git a/openstack-tf/d4s-dev/timescaledb/outputs.tf b/openstack-tf/d4s-dev/timescaledb/outputs.tf new file mode 120000 index 00000000..df9f7687 --- /dev/null +++ b/openstack-tf/d4s-dev/timescaledb/outputs.tf @@ -0,0 +1 @@ +../../common_variables/outputs.tf \ No newline at end of file diff --git a/openstack-tf/d4s-dev/timescaledb/variables-dev.tf b/openstack-tf/d4s-dev/timescaledb/variables-dev.tf new file mode 120000 index 00000000..fde4869e --- /dev/null +++ b/openstack-tf/d4s-dev/timescaledb/variables-dev.tf @@ -0,0 +1 @@ +../variables/variables-dev.tf \ No newline at end of file diff --git a/openstack-tf/d4s-dev/timescaledb/variables.tf b/openstack-tf/d4s-dev/timescaledb/variables.tf new file mode 120000 index 00000000..4d07fb47 --- /dev/null +++ b/openstack-tf/d4s-dev/timescaledb/variables.tf @@ -0,0 +1 @@ +../../common_variables/variables.tf \ No newline at end of file diff --git a/openstack-tf/d4s-dev/variables/00-variables.tf b/openstack-tf/d4s-dev/variables/variables-dev.tf similarity index 78% rename from openstack-tf/d4s-dev/variables/00-variables.tf rename to openstack-tf/d4s-dev/variables/variables-dev.tf index 60498675..a151ee79 100644 --- a/openstack-tf/d4s-dev/variables/00-variables.tf +++ b/openstack-tf/d4s-dev/variables/variables-dev.tf @@ -29,11 +29,6 @@ variable "main_private_network" { } } -variable "main_private_network_id" { - # Set with the correct value after the setup is complete - default = "" -} - variable "main_private_subnet" { type = map(string) default = { @@ -46,11 +41,6 @@ variable "main_private_subnet" { } } -variable "main_private_subnet_id" { - # Set with the correct value after the setup is complete - default = "" -} - variable "external_router" { type = map(string) default = { @@ -60,6 +50,22 @@ variable "external_router" { } } +variable "main_haproxy_l7_ip" { + type = list(string) + default = ["10.1.28.50", "10.1.30.241"] +} + +variable "octavia_information" { + type = map(string) + default = { + main_lb_name = "lb-dev-l4" + main_lb_description = "Main L4 load balancer for the D4Science DEV" + octavia_flavor = "octavia_amphora-mvcpu-ha" + octavia_flavor_id = "394988b5-6603-4a1e-a939-8e177c6681c7" + main_lb_hostname = "main-lb" + } +} + variable "basic_services_ip" { type = map(string) default = { @@ -77,39 +83,3 @@ variable "basic_services_ip" { octavia_main_cidr = "10.1.28.227/32" } } - -variable "main_haproxy_l7_ip" { - type = list(string) - default = ["10.1.28.50", "10.1.30.241"] -} - -variable "octavia_information" { - type = map(string) - default = { - main_lb_name = "lb-dev-l4" - main_lb_description = "Main L4 load balancer for the D4Science DEV" - octavia_flavor = "octavia_amphora-mvcpu-ha" - octavia_flavor_id = "394988b5-6603-4a1e-a939-8e177c6681c7" - main_lb_hostname = "main-lb" - } -} - -variable "default_security_group_name" { - default = "default" -} - -variable "resource_registry_addresses" { - type = map(string) - default = { - r1 = "10.1.28.73" - r2 = "10.1.28.157" - } -} - -variable "smartexecutor_addresses" { - type = map(string) - default = { - r1 = "10.1.28.73" - r2 = "10.1.28.157" - } -} diff --git a/openstack-tf/d4s-production/basic-infrastructure/00-terraform-provider.tf b/openstack-tf/d4s-production/basic-infrastructure/00-terraform-provider.tf deleted file mode 120000 index c094d201..00000000 --- a/openstack-tf/d4s-production/basic-infrastructure/00-terraform-provider.tf +++ /dev/null @@ -1 +0,0 @@ -../../common_variables/00-terraform-provider.tf \ No newline at end of file diff --git a/openstack-tf/d4s-production/basic-infrastructure/00-variables.tf b/openstack-tf/d4s-production/basic-infrastructure/00-variables.tf deleted file mode 120000 index df2af105..00000000 --- a/openstack-tf/d4s-production/basic-infrastructure/00-variables.tf +++ /dev/null @@ -1 +0,0 @@ -../variables/00-variables.tf \ No newline at end of file diff --git a/openstack-tf/d4s-production/basic-infrastructure/01-external-network-and-resolvers.tf b/openstack-tf/d4s-production/basic-infrastructure/01-external-network-and-resolvers.tf deleted file mode 120000 index c53c78ad..00000000 --- a/openstack-tf/d4s-production/basic-infrastructure/01-external-network-and-resolvers.tf +++ /dev/null @@ -1 +0,0 @@ -../../common_variables/01-external-network-and-resolvers.tf \ No newline at end of file diff --git a/openstack-tf/d4s-production/basic-infrastructure/05-projects-and-users-vars.tf b/openstack-tf/d4s-production/basic-infrastructure/05-projects-and-users-vars.tf deleted file mode 120000 index 22fce1fb..00000000 --- a/openstack-tf/d4s-production/basic-infrastructure/05-projects-and-users-vars.tf +++ /dev/null @@ -1 +0,0 @@ -../../common_variables/05-projects-and-users-vars.tf \ No newline at end of file diff --git a/openstack-tf/d4s-production/basic-infrastructure/docker-swarm.tf b/openstack-tf/d4s-production/basic-infrastructure/docker-swarm.tf index f15e8235..afb0c71c 120000 --- a/openstack-tf/d4s-production/basic-infrastructure/docker-swarm.tf +++ b/openstack-tf/d4s-production/basic-infrastructure/docker-swarm.tf @@ -1 +1 @@ -../../docker_swarm_setup/docker-swarm.tf \ No newline at end of file +../../modules/docker_swarm/docker-swarm.tf \ No newline at end of file diff --git a/openstack-tf/d4s-production/basic-infrastructure/provider.tf b/openstack-tf/d4s-production/basic-infrastructure/provider.tf index a0cf95eb..3d1a6e28 100644 --- a/openstack-tf/d4s-production/basic-infrastructure/provider.tf +++ b/openstack-tf/d4s-production/basic-infrastructure/provider.tf @@ -1,3 +1,14 @@ +# Define required providers +terraform { +required_version = ">= 0.14.0" + required_providers { + openstack = { + source = "terraform-provider-openstack/openstack" + version = "~> 1.53.0" + } + } +} + provider "openstack" { cloud = "d4s-production" } diff --git a/openstack-tf/d4s-production/basic-infrastructure/swarm-variables.tf b/openstack-tf/d4s-production/basic-infrastructure/swarm-variables.tf index 150f70a9..77642fe4 120000 --- a/openstack-tf/d4s-production/basic-infrastructure/swarm-variables.tf +++ b/openstack-tf/d4s-production/basic-infrastructure/swarm-variables.tf @@ -1 +1 @@ -../../docker_swarm_setup/swarm-variables.tf \ No newline at end of file +../../modules/docker_swarm/swarm-variables.tf \ No newline at end of file diff --git a/openstack-tf/d4s-production/basic-infrastructure/variables-production.tf b/openstack-tf/d4s-production/basic-infrastructure/variables-production.tf new file mode 120000 index 00000000..033bd2b1 --- /dev/null +++ b/openstack-tf/d4s-production/basic-infrastructure/variables-production.tf @@ -0,0 +1 @@ +../variables/variables-production.tf \ No newline at end of file diff --git a/openstack-tf/d4s-production/basic-infrastructure/variables.tf b/openstack-tf/d4s-production/basic-infrastructure/variables.tf new file mode 120000 index 00000000..be9f7878 --- /dev/null +++ b/openstack-tf/d4s-production/basic-infrastructure/variables.tf @@ -0,0 +1 @@ +../../modules/common_variables/variables.tf \ No newline at end of file diff --git a/openstack-tf/d4s-production/mongodb/.terraform.lock.hcl b/openstack-tf/d4s-production/mongodb/.terraform.lock.hcl new file mode 100644 index 00000000..46d2bb65 --- /dev/null +++ b/openstack-tf/d4s-production/mongodb/.terraform.lock.hcl @@ -0,0 +1,24 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/terraform-provider-openstack/openstack" { + version = "1.53.0" + constraints = "~> 1.53.0" + hashes = [ + "h1:ZSJPqrlaHQ3sj7wyJuPSG+NblFZbAA6Y0d3GjSJf3o8=", + "zh:09da7ca98ffd3de7b9ce36c4c13446212a6e763ba1162be71b50f95d453cb68e", + "zh:14041bcbb87312411d88612056ed185650bfd01284b8ea0761ce8105a331708e", + "zh:35bf4c788fdbc17c8e40ebc7b33c7de4b45a2fa2efaa657b10f0e3bd37c9627f", + "zh:46ede8ef4cfa12d654c538afc1e1ec34a1f3e8eb4e986ee23dceae398b7176a6", + "zh:59675734990dab1e8d87997853ea75e8104bba730b3f5a7146ac735540c9d6bf", + "zh:6de52428849806498670e827b54810be7510a2a79449602c1aede4235a0ec036", + "zh:78b2a20601272afceffac8f8ca78a6b647b84196c0dd8dc710fae297f6be15a4", + "zh:7c41ed3a4fac09677e676ecf9f9edd1e38eef449e656cb01a848d2c799c6de8f", + "zh:852800228f4118a4aa6cfaa4468b851247cbed6f037fd204f08de69eb1edc149", + "zh:86d618e7f9a07d978b8bc4b190be350a00de64ec535f9c8f5dfe133542a55483", + "zh:963a9e72b66d8bcf43de9b14a674ae3ca3719ce2f829217f7a65b66fc3773397", + "zh:a8e72ab67795071bda61f99a6de3d2d40122fb51971768fd75e1324abe874ced", + "zh:ce1890cf3af17d569af3bc7673cec0a8f78e6f5d701767593f3d29c551f44848", + "zh:e6f1b96eb684f527a47f71923f268c86a36d7894751b31ee9e726d7502a639cd", + ] +} diff --git a/openstack-tf/d4s-production/mongodb/main.tf b/openstack-tf/d4s-production/mongodb/main.tf new file mode 100644 index 00000000..00dcf687 --- /dev/null +++ b/openstack-tf/d4s-production/mongodb/main.tf @@ -0,0 +1,26 @@ +# 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" + } +} + +# module "variables" { +# source = "../variables" +# } + +# module "mongodb" { +# source = "../../modules/mongodb" +# } diff --git a/openstack-tf/d4s-production/mongodb/mongodb.auto.tfvars b/openstack-tf/d4s-production/mongodb/mongodb.auto.tfvars new file mode 100644 index 00000000..231b5e11 --- /dev/null +++ b/openstack-tf/d4s-production/mongodb/mongodb.auto.tfvars @@ -0,0 +1,20 @@ +mongodb_cluster_data = { + count = 4 + name = "mongodb-replica" + flavor = "m2.large" + data_disk_size = 10000 + image_type_name = "Ubuntu-Focal-20.04" + image_type_uuid = "75c23040-2be7-49e9-8029-a16dc9f755d1" +} + +mongodb_ip = [ "10.1.40.22", "10.1.40.23", "10.1.40.24", "10.1.40.25" ] + +mongodb_vol_data = { + name = "mongodb-vol" + flavor = "m1.medium" + data_disk_size = 200 + image_type_name = "Ubuntu-Focal-20.04" + image_type_uuid = "75c23040-2be7-49e9-8029-a16dc9f755d1" +} + +mongodb_vol_ip = "10.1.40.29" diff --git a/openstack-tf/d4s-production/mongodb/mongodb.tf b/openstack-tf/d4s-production/mongodb/mongodb.tf new file mode 120000 index 00000000..53a7ada6 --- /dev/null +++ b/openstack-tf/d4s-production/mongodb/mongodb.tf @@ -0,0 +1 @@ +../../modules/mongodb/mongodb.tf \ No newline at end of file diff --git a/openstack-tf/d4s-production/mongodb/provider.tf b/openstack-tf/d4s-production/mongodb/provider.tf new file mode 100644 index 00000000..a0cf95eb --- /dev/null +++ b/openstack-tf/d4s-production/mongodb/provider.tf @@ -0,0 +1,3 @@ +provider "openstack" { + cloud = "d4s-production" +} diff --git a/openstack-tf/d4s-production/mongodb/terraform.tfstate b/openstack-tf/d4s-production/mongodb/terraform.tfstate new file mode 100644 index 00000000..e18f4b3b --- /dev/null +++ b/openstack-tf/d4s-production/mongodb/terraform.tfstate @@ -0,0 +1,1234 @@ +{ + "version": 4, + "terraform_version": "1.6.4", + "serial": 39, + "lineage": "8125b507-dffc-191e-5c2e-5ad0afce4380", + "outputs": {}, + "resources": [ + { + "mode": "data", + "type": "terraform_remote_state", + "name": "privnet_dns_router", + "provider": "provider[\"terraform.io/builtin/terraform\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "backend": "local", + "config": { + "value": { + "path": "../project-setup/terraform.tfstate" + }, + "type": [ + "object", + { + "path": "string" + } + ] + }, + "defaults": null, + "outputs": { + "value": { + "dns_zone_id": "74135b34-1a9c-4c01-8cf0-22450a5660c4", + "external_gateway_ip": "146.48.31.57", + "main_private_network_id": "020df98d-ae72-452a-b376-3b6dc289acac", + "main_subnet_network_id": "5d7b83ad-e058-4a3a-bfd8-d20ba6d42e1a" + }, + "type": [ + "object", + { + "dns_zone_id": "string", + "external_gateway_ip": "string", + "main_private_network_id": "string", + "main_subnet_network_id": "string" + } + ] + }, + "workspace": null + }, + "sensitive_attributes": [] + } + ] + }, + { + "mode": "managed", + "type": "openstack_compute_floatingip_associate_v2", + "name": "mongodb_cluster_ip", + "provider": "provider[\"registry.terraform.io/terraform-provider-openstack/openstack\"]", + "instances": [ + { + "index_key": 0, + "schema_version": 0, + "attributes": { + "fixed_ip": "", + "floating_ip": "146.48.30.60", + "id": "146.48.30.60/c49bbdcb-64a8-465c-8a8f-5473031cf149/", + "instance_id": "c49bbdcb-64a8-465c-8a8f-5473031cf149", + "region": "isti_area_pi_1", + "timeouts": null, + "wait_until_associated": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "openstack_compute_instance_v2.mongodb_cluster_nodes", + "openstack_compute_servergroup_v2.mongodb", + "openstack_networking_floatingip_v2.mongodb_cluster_floating_ip", + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + }, + { + "index_key": 1, + "schema_version": 0, + "attributes": { + "fixed_ip": "", + "floating_ip": "146.48.30.122", + "id": "146.48.30.122/39c02c77-5b13-4164-ac9f-6f61af2e41dc/", + "instance_id": "39c02c77-5b13-4164-ac9f-6f61af2e41dc", + "region": "isti_area_pi_1", + "timeouts": null, + "wait_until_associated": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "openstack_compute_instance_v2.mongodb_cluster_nodes", + "openstack_compute_servergroup_v2.mongodb", + "openstack_networking_floatingip_v2.mongodb_cluster_floating_ip", + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + }, + { + "index_key": 2, + "schema_version": 0, + "attributes": { + "fixed_ip": "", + "floating_ip": "146.48.30.152", + "id": "146.48.30.152/123694fe-a8d6-4b00-99e6-316f5c47e104/", + "instance_id": "123694fe-a8d6-4b00-99e6-316f5c47e104", + "region": "isti_area_pi_1", + "timeouts": null, + "wait_until_associated": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "openstack_compute_instance_v2.mongodb_cluster_nodes", + "openstack_compute_servergroup_v2.mongodb", + "openstack_networking_floatingip_v2.mongodb_cluster_floating_ip", + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + }, + { + "index_key": 3, + "schema_version": 0, + "attributes": { + "fixed_ip": "", + "floating_ip": "146.48.30.16", + "id": "146.48.30.16/3f8048f9-6e59-47d9-b47d-505e0d604e97/", + "instance_id": "3f8048f9-6e59-47d9-b47d-505e0d604e97", + "region": "isti_area_pi_1", + "timeouts": null, + "wait_until_associated": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "openstack_compute_instance_v2.mongodb_cluster_nodes", + "openstack_compute_servergroup_v2.mongodb", + "openstack_networking_floatingip_v2.mongodb_cluster_floating_ip", + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + } + ] + }, + { + "mode": "managed", + "type": "openstack_compute_floatingip_associate_v2", + "name": "mongodb_vol_public_ip", + "provider": "provider[\"registry.terraform.io/terraform-provider-openstack/openstack\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "fixed_ip": "", + "floating_ip": "146.48.29.214", + "id": "146.48.29.214/1cbd5e71-b19d-49ab-bd5d-45d10adb7435/", + "instance_id": "1cbd5e71-b19d-49ab-bd5d-45d10adb7435", + "region": "isti_area_pi_1", + "timeouts": null, + "wait_until_associated": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "openstack_compute_instance_v2.mongodb_vol_node", + "openstack_networking_floatingip_v2.mongodb_vol_floating_ip", + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + } + ] + }, + { + "mode": "managed", + "type": "openstack_compute_instance_v2", + "name": "mongodb_cluster_nodes", + "provider": "provider[\"registry.terraform.io/terraform-provider-openstack/openstack\"]", + "instances": [ + { + "index_key": 0, + "schema_version": 0, + "attributes": { + "access_ip_v4": "10.1.40.22", + "access_ip_v6": "", + "admin_pass": null, + "all_metadata": {}, + "all_tags": [], + "availability_zone": "cnr-isti-nova-a", + "availability_zone_hints": "cnr-isti-nova-a", + "block_device": [ + { + "boot_index": 0, + "delete_on_termination": false, + "destination_type": "volume", + "device_type": "", + "disk_bus": "", + "guest_format": "", + "multiattach": false, + "source_type": "image", + "uuid": "75c23040-2be7-49e9-8029-a16dc9f755d1", + "volume_size": 10, + "volume_type": "" + }, + { + "boot_index": -1, + "delete_on_termination": false, + "destination_type": "volume", + "device_type": "", + "disk_bus": "", + "guest_format": "", + "multiattach": false, + "source_type": "blank", + "uuid": "", + "volume_size": 10000, + "volume_type": "" + } + ], + "config_drive": null, + "created": "2023-11-17 15:31:58 +0000 UTC", + "flavor_id": "20", + "flavor_name": "m2.large", + "floating_ip": null, + "force_delete": false, + "id": "c49bbdcb-64a8-465c-8a8f-5473031cf149", + "image_id": "Attempt to boot from volume - no image supplied", + "image_name": null, + "key_pair": "adellam", + "metadata": null, + "name": "mongodb-replica-02", + "network": [ + { + "access_network": false, + "fixed_ip_v4": "10.1.40.22", + "fixed_ip_v6": "", + "floating_ip": "", + "mac": "fa:16:3e:4b:f4:8b", + "name": "d4s-production-cloud-main", + "port": "", + "uuid": "020df98d-ae72-452a-b376-3b6dc289acac" + } + ], + "network_mode": null, + "personality": [], + "power_state": "active", + "region": "isti_area_pi_1", + "scheduler_hints": [ + { + "additional_properties": {}, + "build_near_host_ip": "", + "different_cell": [], + "different_host": [], + "group": "9b123bae-b320-439b-a638-3cdb20127d67", + "query": [], + "same_host": [], + "target_cell": "" + } + ], + "security_groups": [ + "default_for_all", + "mongodb_cluster_traffic" + ], + "stop_before_destroy": false, + "tags": [], + "timeouts": null, + "updated": "2023-11-17 15:32:35 +0000 UTC", + "user_data": "bb83b25fd1219aa1b850ece9be8d7b0f31714608", + "vendor_options": [], + "volume": [] + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInVwZGF0ZSI6MTgwMDAwMDAwMDAwMH19", + "dependencies": [ + "openstack_compute_servergroup_v2.mongodb", + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + }, + { + "index_key": 1, + "schema_version": 0, + "attributes": { + "access_ip_v4": "10.1.40.23", + "access_ip_v6": "", + "admin_pass": null, + "all_metadata": {}, + "all_tags": [], + "availability_zone": "cnr-isti-nova-a", + "availability_zone_hints": "cnr-isti-nova-a", + "block_device": [ + { + "boot_index": 0, + "delete_on_termination": false, + "destination_type": "volume", + "device_type": "", + "disk_bus": "", + "guest_format": "", + "multiattach": false, + "source_type": "image", + "uuid": "75c23040-2be7-49e9-8029-a16dc9f755d1", + "volume_size": 10, + "volume_type": "" + }, + { + "boot_index": -1, + "delete_on_termination": false, + "destination_type": "volume", + "device_type": "", + "disk_bus": "", + "guest_format": "", + "multiattach": false, + "source_type": "blank", + "uuid": "", + "volume_size": 10000, + "volume_type": "" + } + ], + "config_drive": null, + "created": "2023-11-17 15:27:06 +0000 UTC", + "flavor_id": "20", + "flavor_name": "m2.large", + "floating_ip": null, + "force_delete": false, + "id": "39c02c77-5b13-4164-ac9f-6f61af2e41dc", + "image_id": "Attempt to boot from volume - no image supplied", + "image_name": null, + "key_pair": "adellam", + "metadata": null, + "name": "mongodb-replica-03", + "network": [ + { + "access_network": false, + "fixed_ip_v4": "10.1.40.23", + "fixed_ip_v6": "", + "floating_ip": "", + "mac": "fa:16:3e:76:01:25", + "name": "d4s-production-cloud-main", + "port": "", + "uuid": "020df98d-ae72-452a-b376-3b6dc289acac" + } + ], + "network_mode": null, + "personality": [], + "power_state": "active", + "region": "isti_area_pi_1", + "scheduler_hints": [ + { + "additional_properties": {}, + "build_near_host_ip": "", + "different_cell": [], + "different_host": [], + "group": "9b123bae-b320-439b-a638-3cdb20127d67", + "query": [], + "same_host": [], + "target_cell": "" + } + ], + "security_groups": [ + "default_for_all", + "mongodb_cluster_traffic" + ], + "stop_before_destroy": false, + "tags": [], + "timeouts": null, + "updated": "2023-11-17 15:27:51 +0000 UTC", + "user_data": "bb83b25fd1219aa1b850ece9be8d7b0f31714608", + "vendor_options": [], + "volume": [] + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInVwZGF0ZSI6MTgwMDAwMDAwMDAwMH19", + "dependencies": [ + "openstack_compute_servergroup_v2.mongodb", + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + }, + { + "index_key": 2, + "schema_version": 0, + "attributes": { + "access_ip_v4": "10.1.40.24", + "access_ip_v6": "", + "admin_pass": null, + "all_metadata": {}, + "all_tags": [], + "availability_zone": "cnr-isti-nova-a", + "availability_zone_hints": "cnr-isti-nova-a", + "block_device": [ + { + "boot_index": 0, + "delete_on_termination": false, + "destination_type": "volume", + "device_type": "", + "disk_bus": "", + "guest_format": "", + "multiattach": false, + "source_type": "image", + "uuid": "75c23040-2be7-49e9-8029-a16dc9f755d1", + "volume_size": 10, + "volume_type": "" + }, + { + "boot_index": -1, + "delete_on_termination": false, + "destination_type": "volume", + "device_type": "", + "disk_bus": "", + "guest_format": "", + "multiattach": false, + "source_type": "blank", + "uuid": "", + "volume_size": 10000, + "volume_type": "" + } + ], + "config_drive": null, + "created": "2023-11-17 15:27:07 +0000 UTC", + "flavor_id": "20", + "flavor_name": "m2.large", + "floating_ip": null, + "force_delete": false, + "id": "123694fe-a8d6-4b00-99e6-316f5c47e104", + "image_id": "Attempt to boot from volume - no image supplied", + "image_name": null, + "key_pair": "adellam", + "metadata": null, + "name": "mongodb-replica-04", + "network": [ + { + "access_network": false, + "fixed_ip_v4": "10.1.40.24", + "fixed_ip_v6": "", + "floating_ip": "", + "mac": "fa:16:3e:cc:dc:87", + "name": "d4s-production-cloud-main", + "port": "", + "uuid": "020df98d-ae72-452a-b376-3b6dc289acac" + } + ], + "network_mode": null, + "personality": [], + "power_state": "active", + "region": "isti_area_pi_1", + "scheduler_hints": [ + { + "additional_properties": {}, + "build_near_host_ip": "", + "different_cell": [], + "different_host": [], + "group": "9b123bae-b320-439b-a638-3cdb20127d67", + "query": [], + "same_host": [], + "target_cell": "" + } + ], + "security_groups": [ + "default_for_all", + "mongodb_cluster_traffic" + ], + "stop_before_destroy": false, + "tags": [], + "timeouts": null, + "updated": "2023-11-17 15:28:02 +0000 UTC", + "user_data": "bb83b25fd1219aa1b850ece9be8d7b0f31714608", + "vendor_options": [], + "volume": [] + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInVwZGF0ZSI6MTgwMDAwMDAwMDAwMH19", + "dependencies": [ + "openstack_compute_servergroup_v2.mongodb", + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + }, + { + "index_key": 3, + "schema_version": 0, + "attributes": { + "access_ip_v4": "10.1.40.25", + "access_ip_v6": "", + "admin_pass": null, + "all_metadata": {}, + "all_tags": [], + "availability_zone": "cnr-isti-nova-a", + "availability_zone_hints": "cnr-isti-nova-a", + "block_device": [ + { + "boot_index": 0, + "delete_on_termination": false, + "destination_type": "volume", + "device_type": "", + "disk_bus": "", + "guest_format": "", + "multiattach": false, + "source_type": "image", + "uuid": "75c23040-2be7-49e9-8029-a16dc9f755d1", + "volume_size": 10, + "volume_type": "" + }, + { + "boot_index": -1, + "delete_on_termination": false, + "destination_type": "volume", + "device_type": "", + "disk_bus": "", + "guest_format": "", + "multiattach": false, + "source_type": "blank", + "uuid": "", + "volume_size": 10000, + "volume_type": "" + } + ], + "config_drive": null, + "created": "2023-11-17 15:27:06 +0000 UTC", + "flavor_id": "20", + "flavor_name": "m2.large", + "floating_ip": null, + "force_delete": false, + "id": "3f8048f9-6e59-47d9-b47d-505e0d604e97", + "image_id": "Attempt to boot from volume - no image supplied", + "image_name": null, + "key_pair": "adellam", + "metadata": null, + "name": "mongodb-replica-05", + "network": [ + { + "access_network": false, + "fixed_ip_v4": "10.1.40.25", + "fixed_ip_v6": "", + "floating_ip": "", + "mac": "fa:16:3e:a0:14:ed", + "name": "d4s-production-cloud-main", + "port": "", + "uuid": "020df98d-ae72-452a-b376-3b6dc289acac" + } + ], + "network_mode": null, + "personality": [], + "power_state": "active", + "region": "isti_area_pi_1", + "scheduler_hints": [ + { + "additional_properties": {}, + "build_near_host_ip": "", + "different_cell": [], + "different_host": [], + "group": "9b123bae-b320-439b-a638-3cdb20127d67", + "query": [], + "same_host": [], + "target_cell": "" + } + ], + "security_groups": [ + "default_for_all", + "mongodb_cluster_traffic" + ], + "stop_before_destroy": false, + "tags": [], + "timeouts": null, + "updated": "2023-11-17 15:27:53 +0000 UTC", + "user_data": "bb83b25fd1219aa1b850ece9be8d7b0f31714608", + "vendor_options": [], + "volume": [] + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInVwZGF0ZSI6MTgwMDAwMDAwMDAwMH19", + "dependencies": [ + "openstack_compute_servergroup_v2.mongodb", + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + } + ] + }, + { + "mode": "managed", + "type": "openstack_compute_instance_v2", + "name": "mongodb_vol_node", + "provider": "provider[\"registry.terraform.io/terraform-provider-openstack/openstack\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "access_ip_v4": "10.1.40.29", + "access_ip_v6": "", + "admin_pass": null, + "all_metadata": {}, + "all_tags": [], + "availability_zone": "cnr-isti-nova-a", + "availability_zone_hints": "cnr-isti-nova-a", + "block_device": [ + { + "boot_index": 0, + "delete_on_termination": false, + "destination_type": "volume", + "device_type": "", + "disk_bus": "", + "guest_format": "", + "multiattach": false, + "source_type": "image", + "uuid": "75c23040-2be7-49e9-8029-a16dc9f755d1", + "volume_size": 10, + "volume_type": "" + }, + { + "boot_index": -1, + "delete_on_termination": false, + "destination_type": "volume", + "device_type": "", + "disk_bus": "", + "guest_format": "", + "multiattach": false, + "source_type": "blank", + "uuid": "", + "volume_size": 200, + "volume_type": "" + } + ], + "config_drive": null, + "created": "2023-11-17 15:36:25 +0000 UTC", + "flavor_id": "4", + "flavor_name": "m1.medium", + "floating_ip": null, + "force_delete": false, + "id": "1cbd5e71-b19d-49ab-bd5d-45d10adb7435", + "image_id": "Attempt to boot from volume - no image supplied", + "image_name": null, + "key_pair": "adellam", + "metadata": null, + "name": "mongodb-vol", + "network": [ + { + "access_network": false, + "fixed_ip_v4": "10.1.40.29", + "fixed_ip_v6": "", + "floating_ip": "", + "mac": "fa:16:3e:4d:ef:81", + "name": "d4s-production-cloud-main", + "port": "", + "uuid": "020df98d-ae72-452a-b376-3b6dc289acac" + } + ], + "network_mode": null, + "personality": [], + "power_state": "active", + "region": "isti_area_pi_1", + "scheduler_hints": [], + "security_groups": [ + "default_for_all", + "mongodb_cluster_traffic" + ], + "stop_before_destroy": false, + "tags": null, + "timeouts": null, + "updated": "2023-11-17 15:37:07 +0000 UTC", + "user_data": "bb83b25fd1219aa1b850ece9be8d7b0f31714608", + "vendor_options": [], + "volume": [] + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInVwZGF0ZSI6MTgwMDAwMDAwMDAwMH19", + "dependencies": [ + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + } + ] + }, + { + "mode": "managed", + "type": "openstack_compute_servergroup_v2", + "name": "mongodb", + "provider": "provider[\"registry.terraform.io/terraform-provider-openstack/openstack\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "id": "9b123bae-b320-439b-a638-3cdb20127d67", + "members": [ + "c49bbdcb-64a8-465c-8a8f-5473031cf149", + "123694fe-a8d6-4b00-99e6-316f5c47e104", + "39c02c77-5b13-4164-ac9f-6f61af2e41dc", + "3f8048f9-6e59-47d9-b47d-505e0d604e97" + ], + "name": "mongodb", + "policies": [ + "anti-affinity" + ], + "region": "isti_area_pi_1", + "rules": [ + { + "max_server_per_host": 0 + } + ], + "value_specs": null + }, + "sensitive_attributes": [], + "private": "bnVsbA==" + } + ] + }, + { + "mode": "managed", + "type": "openstack_dns_recordset_v2", + "name": "mongodb_cluster_dns_recordsets", + "provider": "provider[\"registry.terraform.io/terraform-provider-openstack/openstack\"]", + "instances": [ + { + "index_key": 0, + "schema_version": 0, + "attributes": { + "description": "Mongodb public hostnames", + "disable_status_check": false, + "id": "74135b34-1a9c-4c01-8cf0-22450a5660c4/91f99f9f-0aaa-4b12-b1d0-4460988c247e", + "name": "mongodb-replica-02.cloud.d4science.org.", + "project_id": "1b45adf388934758b56d0dfdb4bfacf3", + "records": [ + "146.48.30.60" + ], + "region": "isti_area_pi_1", + "timeouts": null, + "ttl": 8600, + "type": "A", + "value_specs": null, + "zone_id": "74135b34-1a9c-4c01-8cf0-22450a5660c4" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH19", + "dependencies": [ + "openstack_compute_instance_v2.mongodb_cluster_nodes", + "openstack_compute_servergroup_v2.mongodb", + "openstack_networking_floatingip_v2.mongodb_cluster_floating_ip", + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + }, + { + "index_key": 1, + "schema_version": 0, + "attributes": { + "description": "Mongodb public hostnames", + "disable_status_check": false, + "id": "74135b34-1a9c-4c01-8cf0-22450a5660c4/fa0e124c-e571-4bbf-85df-fdb9bd0b0a5a", + "name": "mongodb-replica-03.cloud.d4science.org.", + "project_id": "1b45adf388934758b56d0dfdb4bfacf3", + "records": [ + "146.48.30.122" + ], + "region": "isti_area_pi_1", + "timeouts": null, + "ttl": 8600, + "type": "A", + "value_specs": null, + "zone_id": "74135b34-1a9c-4c01-8cf0-22450a5660c4" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH19", + "dependencies": [ + "openstack_compute_instance_v2.mongodb_cluster_nodes", + "openstack_compute_servergroup_v2.mongodb", + "openstack_networking_floatingip_v2.mongodb_cluster_floating_ip", + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + }, + { + "index_key": 2, + "schema_version": 0, + "attributes": { + "description": "Mongodb public hostnames", + "disable_status_check": false, + "id": "74135b34-1a9c-4c01-8cf0-22450a5660c4/4103c87f-16e7-4f89-bb5e-32737130eff6", + "name": "mongodb-replica-04.cloud.d4science.org.", + "project_id": "1b45adf388934758b56d0dfdb4bfacf3", + "records": [ + "146.48.30.152" + ], + "region": "isti_area_pi_1", + "timeouts": null, + "ttl": 8600, + "type": "A", + "value_specs": null, + "zone_id": "74135b34-1a9c-4c01-8cf0-22450a5660c4" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH19", + "dependencies": [ + "openstack_compute_instance_v2.mongodb_cluster_nodes", + "openstack_compute_servergroup_v2.mongodb", + "openstack_networking_floatingip_v2.mongodb_cluster_floating_ip", + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + }, + { + "index_key": 3, + "schema_version": 0, + "attributes": { + "description": "Mongodb public hostnames", + "disable_status_check": false, + "id": "74135b34-1a9c-4c01-8cf0-22450a5660c4/1873ba94-3b02-44ce-be03-665f7a4d5947", + "name": "mongodb-replica-05.cloud.d4science.org.", + "project_id": "1b45adf388934758b56d0dfdb4bfacf3", + "records": [ + "146.48.30.16" + ], + "region": "isti_area_pi_1", + "timeouts": null, + "ttl": 8600, + "type": "A", + "value_specs": null, + "zone_id": "74135b34-1a9c-4c01-8cf0-22450a5660c4" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH19", + "dependencies": [ + "openstack_compute_instance_v2.mongodb_cluster_nodes", + "openstack_compute_servergroup_v2.mongodb", + "openstack_networking_floatingip_v2.mongodb_cluster_floating_ip", + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + } + ] + }, + { + "mode": "managed", + "type": "openstack_dns_recordset_v2", + "name": "mongodb_vol_dns_recordsets", + "provider": "provider[\"registry.terraform.io/terraform-provider-openstack/openstack\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "description": "Mongodb Volatile public hostnames", + "disable_status_check": false, + "id": "74135b34-1a9c-4c01-8cf0-22450a5660c4/5f014007-9db0-49fc-9a6e-d470d8f2e8f8", + "name": "mongodb-vol.cloud.d4science.org.", + "project_id": "1b45adf388934758b56d0dfdb4bfacf3", + "records": [ + "146.48.29.214" + ], + "region": "isti_area_pi_1", + "timeouts": null, + "ttl": 8600, + "type": "A", + "value_specs": null, + "zone_id": "74135b34-1a9c-4c01-8cf0-22450a5660c4" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH19", + "dependencies": [ + "openstack_compute_instance_v2.mongodb_vol_node", + "openstack_networking_floatingip_v2.mongodb_vol_floating_ip", + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + } + ] + }, + { + "mode": "managed", + "type": "openstack_networking_floatingip_v2", + "name": "mongodb_cluster_floating_ip", + "provider": "provider[\"registry.terraform.io/terraform-provider-openstack/openstack\"]", + "instances": [ + { + "index_key": 0, + "schema_version": 0, + "attributes": { + "address": "146.48.30.60", + "all_tags": [], + "description": "MongoDB cluster node mongodb-replica-02", + "dns_domain": "", + "dns_name": "", + "fixed_ip": "10.1.40.22", + "id": "28fa8705-7f4a-4e77-a9a2-ebee1416d8a7", + "pool": "external-network", + "port_id": "f051575b-2580-4498-94e6-a48c09c4347b", + "region": "isti_area_pi_1", + "subnet_id": null, + "subnet_ids": null, + "tags": [], + "tenant_id": "1b45adf388934758b56d0dfdb4bfacf3", + "timeouts": null, + "value_specs": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwfX0=" + }, + { + "index_key": 1, + "schema_version": 0, + "attributes": { + "address": "146.48.30.122", + "all_tags": [], + "description": "MongoDB cluster node mongodb-replica-03", + "dns_domain": "", + "dns_name": "", + "fixed_ip": "10.1.40.23", + "id": "59ffbb40-7772-437e-9ffa-6f7b783c2338", + "pool": "external-network", + "port_id": "0ee35be3-25dc-4984-87ac-900a2b4f52f9", + "region": "isti_area_pi_1", + "subnet_id": null, + "subnet_ids": null, + "tags": [], + "tenant_id": "1b45adf388934758b56d0dfdb4bfacf3", + "timeouts": null, + "value_specs": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwfX0=" + }, + { + "index_key": 2, + "schema_version": 0, + "attributes": { + "address": "146.48.30.152", + "all_tags": [], + "description": "MongoDB cluster node mongodb-replica-04", + "dns_domain": "", + "dns_name": "", + "fixed_ip": "10.1.40.24", + "id": "c9acbffb-ff01-44f2-acb5-644980f11970", + "pool": "external-network", + "port_id": "77d6d56c-7fdc-4bae-80dc-f103a3aa3d42", + "region": "isti_area_pi_1", + "subnet_id": null, + "subnet_ids": null, + "tags": [], + "tenant_id": "1b45adf388934758b56d0dfdb4bfacf3", + "timeouts": null, + "value_specs": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwfX0=" + }, + { + "index_key": 3, + "schema_version": 0, + "attributes": { + "address": "146.48.30.16", + "all_tags": [], + "description": "MongoDB cluster node mongodb-replica-05", + "dns_domain": "", + "dns_name": "", + "fixed_ip": "10.1.40.25", + "id": "61af36dd-f8c1-49de-96db-c9d1eb81fb22", + "pool": "external-network", + "port_id": "81ee8327-4ba6-4dfc-81c6-a8588d389aea", + "region": "isti_area_pi_1", + "subnet_id": null, + "subnet_ids": null, + "tags": [], + "tenant_id": "1b45adf388934758b56d0dfdb4bfacf3", + "timeouts": null, + "value_specs": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwfX0=" + } + ] + }, + { + "mode": "managed", + "type": "openstack_networking_floatingip_v2", + "name": "mongodb_vol_floating_ip", + "provider": "provider[\"registry.terraform.io/terraform-provider-openstack/openstack\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "address": "146.48.29.214", + "all_tags": [], + "description": "MongoDB Volatile", + "dns_domain": "", + "dns_name": "", + "fixed_ip": "", + "id": "e30940cd-1a48-4e8b-95d9-458f7bc23f16", + "pool": "external-network", + "port_id": "", + "region": "isti_area_pi_1", + "subnet_id": null, + "subnet_ids": null, + "tags": [], + "tenant_id": "1b45adf388934758b56d0dfdb4bfacf3", + "timeouts": null, + "value_specs": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwfX0=" + } + ] + }, + { + "mode": "managed", + "type": "openstack_networking_secgroup_rule_v2", + "name": "access_to_the_mongodb_service_from_the_internal_network", + "provider": "provider[\"registry.terraform.io/terraform-provider-openstack/openstack\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "description": "Access to the MongoDB service", + "direction": "ingress", + "ethertype": "IPv4", + "id": "81c0bf59-dd46-4187-b022-7eb193be7fd2", + "port_range_max": 27017, + "port_range_min": 27017, + "protocol": "tcp", + "region": "isti_area_pi_1", + "remote_group_id": "", + "remote_ip_prefix": "10.1.40.0/21", + "security_group_id": "6db66d56-dfa2-40ce-9724-9fef9e77275c", + "tenant_id": "1b45adf388934758b56d0dfdb4bfacf3", + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiZGVsZXRlIjo2MDAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + } + ] + }, + { + "mode": "managed", + "type": "openstack_networking_secgroup_rule_v2", + "name": "access_to_the_mongodb_service_from_the_outside", + "provider": "provider[\"registry.terraform.io/terraform-provider-openstack/openstack\"]", + "instances": [ + { + "index_key": "146.48.122.0/23", + "schema_version": 0, + "attributes": { + "description": "Access to the MongoDB service", + "direction": "ingress", + "ethertype": "IPv4", + "id": "9df058f5-d99c-45e3-b607-9652deb35e37", + "port_range_max": 27017, + "port_range_min": 27017, + "protocol": "tcp", + "region": "isti_area_pi_1", + "remote_group_id": "", + "remote_ip_prefix": "146.48.122.0/23", + "security_group_id": "6db66d56-dfa2-40ce-9724-9fef9e77275c", + "tenant_id": "1b45adf388934758b56d0dfdb4bfacf3", + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiZGVsZXRlIjo2MDAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + }, + { + "index_key": "146.48.28.0/22", + "schema_version": 0, + "attributes": { + "description": "Access to the MongoDB service", + "direction": "ingress", + "ethertype": "IPv4", + "id": "9cb485e0-5e5c-448e-b802-6775b4ac7f4f", + "port_range_max": 27017, + "port_range_min": 27017, + "protocol": "tcp", + "region": "isti_area_pi_1", + "remote_group_id": "", + "remote_ip_prefix": "146.48.28.0/22", + "security_group_id": "6db66d56-dfa2-40ce-9724-9fef9e77275c", + "tenant_id": "1b45adf388934758b56d0dfdb4bfacf3", + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiZGVsZXRlIjo2MDAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + }, + { + "index_key": "90.147.152.0/24", + "schema_version": 0, + "attributes": { + "description": "Access to the MongoDB service", + "direction": "ingress", + "ethertype": "IPv4", + "id": "1ae6ef42-513d-4f62-bb3d-424c2b6a1538", + "port_range_max": 27017, + "port_range_min": 27017, + "protocol": "tcp", + "region": "isti_area_pi_1", + "remote_group_id": "", + "remote_ip_prefix": "90.147.152.0/24", + "security_group_id": "6db66d56-dfa2-40ce-9724-9fef9e77275c", + "tenant_id": "1b45adf388934758b56d0dfdb4bfacf3", + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiZGVsZXRlIjo2MDAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + }, + { + "index_key": "90.147.166.0/23", + "schema_version": 0, + "attributes": { + "description": "Access to the MongoDB service", + "direction": "ingress", + "ethertype": "IPv4", + "id": "772575fb-0a79-4f2d-ac58-d174827f3ab6", + "port_range_max": 27017, + "port_range_min": 27017, + "protocol": "tcp", + "region": "isti_area_pi_1", + "remote_group_id": "", + "remote_ip_prefix": "90.147.166.0/23", + "security_group_id": "6db66d56-dfa2-40ce-9724-9fef9e77275c", + "tenant_id": "1b45adf388934758b56d0dfdb4bfacf3", + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiZGVsZXRlIjo2MDAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + }, + { + "index_key": "90.147.188.0/23", + "schema_version": 0, + "attributes": { + "description": "Access to the MongoDB service", + "direction": "ingress", + "ethertype": "IPv4", + "id": "7ca4acca-abbe-487f-a8cb-e29defecf5f7", + "port_range_max": 27017, + "port_range_min": 27017, + "protocol": "tcp", + "region": "isti_area_pi_1", + "remote_group_id": "", + "remote_ip_prefix": "90.147.188.0/23", + "security_group_id": "6db66d56-dfa2-40ce-9724-9fef9e77275c", + "tenant_id": "1b45adf388934758b56d0dfdb4bfacf3", + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiZGVsZXRlIjo2MDAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + } + ] + }, + { + "mode": "managed", + "type": "openstack_networking_secgroup_rule_v2", + "name": "mongodb_plain_http_for_letsencrypt", + "provider": "provider[\"registry.terraform.io/terraform-provider-openstack/openstack\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "description": "Plain HTTP for letsencrypt", + "direction": "ingress", + "ethertype": "IPv4", + "id": "aa7bf374-67bb-4e37-a0b2-73201ead67ae", + "port_range_max": 80, + "port_range_min": 80, + "protocol": "tcp", + "region": "isti_area_pi_1", + "remote_group_id": "", + "remote_ip_prefix": "0.0.0.0/0", + "security_group_id": "6db66d56-dfa2-40ce-9724-9fef9e77275c", + "tenant_id": "1b45adf388934758b56d0dfdb4bfacf3", + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiZGVsZXRlIjo2MDAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + } + ] + }, + { + "mode": "managed", + "type": "openstack_networking_secgroup_rule_v2", + "name": "mongodb_prometheus_exporter", + "provider": "provider[\"registry.terraform.io/terraform-provider-openstack/openstack\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "description": "Prometheus exporter for MongoDB", + "direction": "ingress", + "ethertype": "IPv4", + "id": "ad342885-3607-4ff3-901a-78a956911393", + "port_range_max": 9101, + "port_range_min": 9101, + "protocol": "tcp", + "region": "isti_area_pi_1", + "remote_group_id": "", + "remote_ip_prefix": "10.1.40.10/32", + "security_group_id": "6db66d56-dfa2-40ce-9724-9fef9e77275c", + "tenant_id": "1b45adf388934758b56d0dfdb4bfacf3", + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiZGVsZXRlIjo2MDAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "openstack_networking_secgroup_v2.mongodb_cluster_traffic" + ] + } + ] + }, + { + "mode": "managed", + "type": "openstack_networking_secgroup_v2", + "name": "mongodb_cluster_traffic", + "provider": "provider[\"registry.terraform.io/terraform-provider-openstack/openstack\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "all_tags": [], + "delete_default_rules": true, + "description": "Traffic between the MongoDB nodes", + "id": "6db66d56-dfa2-40ce-9724-9fef9e77275c", + "name": "mongodb_cluster_traffic", + "region": "isti_area_pi_1", + "tags": [], + "tenant_id": "1b45adf388934758b56d0dfdb4bfacf3", + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiZGVsZXRlIjo2MDAwMDAwMDAwMDB9fQ==" + } + ] + } + ], + "check_results": null +} diff --git a/openstack-tf/d4s-production/mongodb/variables-mongodb.tf b/openstack-tf/d4s-production/mongodb/variables-mongodb.tf new file mode 120000 index 00000000..e499abfc --- /dev/null +++ b/openstack-tf/d4s-production/mongodb/variables-mongodb.tf @@ -0,0 +1 @@ +../../modules/mongodb/variables-mongodb.tf \ No newline at end of file diff --git a/openstack-tf/d4s-production/mongodb/variables-production.tf b/openstack-tf/d4s-production/mongodb/variables-production.tf new file mode 120000 index 00000000..033bd2b1 --- /dev/null +++ b/openstack-tf/d4s-production/mongodb/variables-production.tf @@ -0,0 +1 @@ +../variables/variables-production.tf \ No newline at end of file diff --git a/openstack-tf/d4s-production/mongodb/variables.tf b/openstack-tf/d4s-production/mongodb/variables.tf new file mode 120000 index 00000000..be9f7878 --- /dev/null +++ b/openstack-tf/d4s-production/mongodb/variables.tf @@ -0,0 +1 @@ +../../modules/common_variables/variables.tf \ No newline at end of file diff --git a/openstack-tf/d4s-production/project-setup/00-terraform-provider.tf b/openstack-tf/d4s-production/project-setup/00-terraform-provider.tf deleted file mode 120000 index c094d201..00000000 --- a/openstack-tf/d4s-production/project-setup/00-terraform-provider.tf +++ /dev/null @@ -1 +0,0 @@ -../../common_variables/00-terraform-provider.tf \ No newline at end of file diff --git a/openstack-tf/d4s-production/project-setup/00-variables.tf b/openstack-tf/d4s-production/project-setup/00-variables.tf deleted file mode 120000 index df2af105..00000000 --- a/openstack-tf/d4s-production/project-setup/00-variables.tf +++ /dev/null @@ -1 +0,0 @@ -../variables/00-variables.tf \ No newline at end of file diff --git a/openstack-tf/d4s-production/project-setup/01-external-network-and-resolvers.tf b/openstack-tf/d4s-production/project-setup/01-external-network-and-resolvers.tf deleted file mode 120000 index c53c78ad..00000000 --- a/openstack-tf/d4s-production/project-setup/01-external-network-and-resolvers.tf +++ /dev/null @@ -1 +0,0 @@ -../../common_variables/01-external-network-and-resolvers.tf \ No newline at end of file diff --git a/openstack-tf/d4s-production/project-setup/setup-provider.tf b/openstack-tf/d4s-production/project-setup/setup-provider.tf index beb5d2ef..544b81b3 100644 --- a/openstack-tf/d4s-production/project-setup/setup-provider.tf +++ b/openstack-tf/d4s-production/project-setup/setup-provider.tf @@ -1,3 +1,14 @@ +# Define required providers +terraform { +required_version = ">= 0.14.0" + required_providers { + openstack = { + source = "terraform-provider-openstack/openstack" + version = "~> 1.53.0" + } + } +} + provider "openstack" { # cloud = "d4s-production" cloud = "ISTI-Cloud" diff --git a/openstack-tf/d4s-production/project-setup/variables-production.tf b/openstack-tf/d4s-production/project-setup/variables-production.tf new file mode 120000 index 00000000..033bd2b1 --- /dev/null +++ b/openstack-tf/d4s-production/project-setup/variables-production.tf @@ -0,0 +1 @@ +../variables/variables-production.tf \ No newline at end of file diff --git a/openstack-tf/d4s-production/project-setup/variables.tf b/openstack-tf/d4s-production/project-setup/variables.tf new file mode 120000 index 00000000..be9f7878 --- /dev/null +++ b/openstack-tf/d4s-production/project-setup/variables.tf @@ -0,0 +1 @@ +../../modules/common_variables/variables.tf \ No newline at end of file diff --git a/openstack-tf/d4s-production/variables/00-variables.tf b/openstack-tf/d4s-production/variables/variables-production.tf similarity index 93% rename from openstack-tf/d4s-production/variables/00-variables.tf rename to openstack-tf/d4s-production/variables/variables-production.tf index 47cf1f90..5345c9ce 100644 --- a/openstack-tf/d4s-production/variables/00-variables.tf +++ b/openstack-tf/d4s-production/variables/variables-production.tf @@ -18,7 +18,7 @@ variable "dns_zone" { variable "dns_zone_id" { # Set with the correct value after the setup is complete - default = "" + default = "74135b34-1a9c-4c01-8cf0-22450a5660c4" } variable "main_private_network" { @@ -31,7 +31,7 @@ variable "main_private_network" { variable "main_private_network_id" { # Set with the correct value after the setup is complete - default = "" + default = "020df98d-ae72-452a-b376-3b6dc289acac" } variable "main_private_subnet" { @@ -48,7 +48,7 @@ variable "main_private_subnet" { variable "main_private_subnet_id" { # Set with the correct value after the setup is complete - default = "" + default = "5d7b83ad-e058-4a3a-bfd8-d20ba6d42e1a" } variable "external_router" { @@ -95,3 +95,4 @@ variable "octavia_information" { main_lb_hostname = "main-lb" } } + diff --git a/openstack-tf/modules/common_variables/external-network-and-resolvers.tf b/openstack-tf/modules/common_variables/external-network-and-resolvers.tf deleted file mode 100644 index 6df860a0..00000000 --- a/openstack-tf/modules/common_variables/external-network-and-resolvers.tf +++ /dev/null @@ -1,50 +0,0 @@ -# Global definitions -variable "main_region" { - type = string - default = "isti_area_pi_1" -} - -variable "external_network" { - type = map(string) - default = { - name = "external-network" - id = "1d2ff137-6ff7-4017-be2b-0d6c4af2353b" - } -} - -variable "floating_ip_pools" { - type = map(string) - default = { - main_public_ip_pool = "external-network" - } -} - -variable "resolvers_ip" { - type = list(string) - default = ["146.48.29.97", "146.48.29.98", "146.48.29.99"] -} - -variable "mtu_size" { - type = number - default = 8942 -} - -variable "availability_zones_names" { - type = map(string) - default = { - availability_zone_no_gpu = "cnr-isti-nova-a" - availability_zone_with_gpu = "cnr-isti-nova-gpu-a" - } -} - -variable "ssh_sources" { - type = map(string) - default = { - s2i2s_vpn_1_cidr = "146.48.28.10/32" - s2i2s_vpn_2_cidr = "146.48.28.11/32" - d4s_vpn_1_cidr = "146.48.122.27/32" - d4s_vpn_2_cidr = "146.48.122.49/32" - shell_d4s_cidr = "146.48.122.95/32" - infrascience_net_cidr = "146.48.122.0/23" - } -} diff --git a/openstack-tf/common_variables/outputs.tf b/openstack-tf/modules/common_variables/outputs.tf similarity index 100% rename from openstack-tf/common_variables/outputs.tf rename to openstack-tf/modules/common_variables/outputs.tf diff --git a/openstack-tf/modules/common_variables/projects-and-users-vars.tf b/openstack-tf/modules/common_variables/projects-and-users-vars.tf deleted file mode 100644 index dc5d9bc7..00000000 --- a/openstack-tf/modules/common_variables/projects-and-users-vars.tf +++ /dev/null @@ -1,52 +0,0 @@ -variable "ssh_key_file" { - type = map(string) - default = { - file = "~/.ssh/id_ed25519" - name = "adellam" - } -} - -variable "ubuntu_1804" { - type = map(string) - - default = { - name = "Ubuntu-Bionic-18.04" - uuid = "7ed6a2cd-2b07-482e-8ce4-f018dff16c89" - } -} - -variable "ubuntu_2204" { - type = map(string) - default = { - name = "Ubuntu-Jammy-22.04" - uuid = "54768889-8556-4be4-a2eb-82a4d9b34627" - } -} - -variable "centos_7" { - type = map(string) - default = { - name = "CentOS-7" - uuid = "f0187a99-64f6-462a-ab5f-ef52fe62f2ca" - } -} - -variable "almalinux_9" { - type = map(string) - default = { - name = "AlmaLinux-9.0-20220718" - uuid = "541650fc-dd19-4f38-bb1d-7333ed9dd688" - } -} - -variable "ubuntu1804_data_file" { - default = "../../openstack_vm_data_scripts/ubuntu1804.sh" -} - -variable "ubuntu2204_data_file" { - default = "../../openstack_vm_data_scripts/ubuntu2204.sh" -} - -variable "el7_data_file" { - default = "../../openstack_vm_data_scripts/el7.sh" -} diff --git a/openstack-tf/common_variables/variables.tf b/openstack-tf/modules/common_variables/variables.tf similarity index 92% rename from openstack-tf/common_variables/variables.tf rename to openstack-tf/modules/common_variables/variables.tf index 6ec81384..41c0e19a 100644 --- a/openstack-tf/common_variables/variables.tf +++ b/openstack-tf/modules/common_variables/variables.tf @@ -49,6 +49,18 @@ variable "ssh_sources" { } } +variable "networks_with_d4s_services" { + type = map(string) + default = { + "isti_net" = "146.48.80.0/21" + "s2i2s_net" = "146.48.28.0/22" + "infrascience_net" = "146.48.122.0/23" + "garr_ct1_net" = "90.147.166.0/23" + "garr_pa1_net" = "90.147.188.0/23" + "garr_na_net" = "90.147.152.0/24" + } +} + variable "ssh_key_file" { type = map(string) default = { diff --git a/openstack-tf/docker_swarm_setup/docker-swarm.tf b/openstack-tf/modules/docker_swarm/docker-swarm.tf similarity index 100% rename from openstack-tf/docker_swarm_setup/docker-swarm.tf rename to openstack-tf/modules/docker_swarm/docker-swarm.tf diff --git a/openstack-tf/docker_swarm_setup/swarm-variables.tf b/openstack-tf/modules/docker_swarm/swarm-variables.tf similarity index 100% rename from openstack-tf/docker_swarm_setup/swarm-variables.tf rename to openstack-tf/modules/docker_swarm/swarm-variables.tf diff --git a/openstack-tf/modules/mongodb/mongodb.tf b/openstack-tf/modules/mongodb/mongodb.tf new file mode 100644 index 00000000..67de0154 --- /dev/null +++ b/openstack-tf/modules/mongodb/mongodb.tf @@ -0,0 +1,185 @@ +# +# Server groups for both the masters and the workers +# +resource "openstack_compute_servergroup_v2" "mongodb" { + name = "mongodb" + policies = ["anti-affinity"] +} +# +# Security groups +# +# Rules +# 80 from 0/0 +# 9101 from prometheus +# 27017 da: garr-ct1, garr-na, garr-pa1, InfraScience, S2I2S +resource "openstack_networking_secgroup_v2" "mongodb_cluster_traffic" { + name = "mongodb_cluster_traffic" + delete_default_rules = "true" + description = "Traffic between the MongoDB nodes" +} +resource "openstack_networking_secgroup_rule_v2" "access_to_the_mongodb_service_from_the_internal_network" { + security_group_id = openstack_networking_secgroup_v2.mongodb_cluster_traffic.id + description = "Access to the MongoDB service" + direction = "ingress" + ethertype = "IPv4" + protocol = "tcp" + port_range_min = 27017 + port_range_max = 27017 + remote_ip_prefix = var.main_private_subnet.cidr +} +resource "openstack_networking_secgroup_rule_v2" "access_to_the_mongodb_service_from_the_outside" { + for_each = toset([var.networks_with_d4s_services.infrascience_net,var.networks_with_d4s_services.s2i2s_net,var.networks_with_d4s_services.garr_ct1_net,var.networks_with_d4s_services.garr_pa1_net,var.networks_with_d4s_services.garr_na_net]) + security_group_id = openstack_networking_secgroup_v2.mongodb_cluster_traffic.id + description = "Access to the MongoDB service" + direction = "ingress" + ethertype = "IPv4" + protocol = "tcp" + port_range_min = 27017 + port_range_max = 27017 + remote_ip_prefix = each.value +} +resource "openstack_networking_secgroup_rule_v2" "mongodb_plain_http_for_letsencrypt" { + security_group_id = openstack_networking_secgroup_v2.mongodb_cluster_traffic.id + description = "Plain HTTP for letsencrypt" + direction = "ingress" + ethertype = "IPv4" + protocol = "tcp" + port_range_min = 80 + port_range_max = 80 + remote_ip_prefix = "0.0.0.0/0" +} +resource "openstack_networking_secgroup_rule_v2" "mongodb_prometheus_exporter" { + security_group_id = openstack_networking_secgroup_v2.mongodb_cluster_traffic.id + description = "Prometheus exporter for MongoDB" + direction = "ingress" + ethertype = "IPv4" + protocol = "tcp" + port_range_min = 9101 + port_range_max = 9101 + remote_ip_prefix = var.basic_services_ip.prometheus_cidr +} + +# +# Mongodb cluster VMs +# +# Instance +resource "openstack_compute_instance_v2" "mongodb_cluster_nodes" { + count = var.mongodb_cluster_data.count + name = format("%s-%02d", var.mongodb_cluster_data.name, count.index+2) + availability_zone_hints = var.availability_zones_names.availability_zone_no_gpu + flavor_name = var.mongodb_cluster_data.flavor + key_pair = var.ssh_key_file.name + security_groups = [var.default_security_group_name,openstack_networking_secgroup_v2.mongodb_cluster_traffic.name] + scheduler_hints { + group = openstack_compute_servergroup_v2.mongodb.id + } + block_device { + uuid = var.mongodb_cluster_data.image_type_uuid + source_type = "image" + volume_size = 10 + boot_index = 0 + destination_type = "volume" + delete_on_termination = false + } + + block_device { + source_type = "blank" + volume_size = var.mongodb_cluster_data.data_disk_size + boot_index = -1 + destination_type = "volume" + delete_on_termination = false + } + + network { + name = var.main_private_network.name + fixed_ip_v4 = var.mongodb_ip.*[count.index] + } + user_data = "${file("${var.ubuntu2204_data_file}")}" +} + +# Allocate a floating IP +resource "openstack_networking_floatingip_v2" "mongodb_cluster_floating_ip" { + count = var.mongodb_cluster_data.count + pool = var.floating_ip_pools.main_public_ip_pool + # The DNS association does not work because of a bug in the OpenStack API + # dns_name = "main-lb" + # dns_domain = var.dns_zone.zone_name + description = format("MongoDB cluster node %s-%02d", var.mongodb_cluster_data.name, count.index+2) +} + +resource "openstack_compute_floatingip_associate_v2" "mongodb_cluster_ip" { + count = var.mongodb_cluster_data.count + floating_ip = element(openstack_networking_floatingip_v2.mongodb_cluster_floating_ip.*.address, count.index) + instance_id = element(openstack_compute_instance_v2.mongodb_cluster_nodes.*.id, count.index) + depends_on = [openstack_networking_floatingip_v2.mongodb_cluster_floating_ip] +} + +resource "openstack_dns_recordset_v2" "mongodb_cluster_dns_recordsets" { + count = var.mongodb_cluster_data.count + zone_id = var.dns_zone_id + name = join(".", [element(openstack_compute_instance_v2.mongodb_cluster_nodes.*.name, count.index), var.dns_zone.zone_name]) + description = "Mongodb public hostnames" + ttl = 8600 + type = "A" + records = [element(openstack_networking_floatingip_v2.mongodb_cluster_floating_ip.*.address, count.index)] + depends_on = [openstack_networking_floatingip_v2.mongodb_cluster_floating_ip] +} + +# +# MongoDB vol node +# +# Instance +resource "openstack_compute_instance_v2" "mongodb_vol_node" { + name = "mongodb-vol" + availability_zone_hints = var.availability_zones_names.availability_zone_no_gpu + flavor_name = var.mongodb_vol_data.flavor + key_pair = var.ssh_key_file.name + security_groups = [var.default_security_group_name,openstack_networking_secgroup_v2.mongodb_cluster_traffic.name] + block_device { + uuid = var.mongodb_vol_data.image_type_uuid + source_type = "image" + volume_size = 10 + boot_index = 0 + destination_type = "volume" + delete_on_termination = false + } + + block_device { + source_type = "blank" + volume_size = var.mongodb_vol_data.data_disk_size + boot_index = -1 + destination_type = "volume" + delete_on_termination = false + } + + network { + name = var.main_private_network.name + fixed_ip_v4 = var.mongodb_vol_ip + } + user_data = "${file("${var.ubuntu2204_data_file}")}" +} + +# Allocate a floating IP +resource "openstack_networking_floatingip_v2" "mongodb_vol_floating_ip" { + pool = var.floating_ip_pools.main_public_ip_pool + # The DNS association does not work because of a bug in the OpenStack API + # dns_name = "main-lb" + # dns_domain = var.dns_zone.zone_name + description = "MongoDB Volatile" +} + +resource "openstack_compute_floatingip_associate_v2" "mongodb_vol_public_ip" { + floating_ip = openstack_networking_floatingip_v2.mongodb_vol_floating_ip.address + instance_id = openstack_compute_instance_v2.mongodb_vol_node.id + depends_on = [openstack_networking_floatingip_v2.mongodb_vol_floating_ip] +} + +resource "openstack_dns_recordset_v2" "mongodb_vol_dns_recordsets" { + zone_id = var.dns_zone_id + name = join(".", [openstack_compute_instance_v2.mongodb_vol_node.name], [var.dns_zone.zone_name]) + description = "Mongodb Volatile public hostnames" + ttl = 8600 + type = "A" + records = [openstack_networking_floatingip_v2.mongodb_vol_floating_ip.address] + depends_on = [openstack_networking_floatingip_v2.mongodb_vol_floating_ip] +} diff --git a/openstack-tf/modules/mongodb/variables-mongodb.tf b/openstack-tf/modules/mongodb/variables-mongodb.tf new file mode 100644 index 00000000..ee3bcc40 --- /dev/null +++ b/openstack-tf/modules/mongodb/variables-mongodb.tf @@ -0,0 +1,32 @@ +variable "mongodb_cluster_data" { + type = map(string) + default = { + count = 3 + name = "mongodb-replica" + flavor = "m1.small" + data_disk_size = 100 + image_type_name = "Ubuntu-Focal-20.04" + image_type_uuid = "75c23040-2be7-49e9-8029-a16dc9f755d1" + } +} + +variable "mongodb_ip" { + type = list(string) + default = [] + +} + +variable "mongodb_vol_data" { + type = map(string) + default = { + name = "mongodb-vol" + flavor = "m1.small" + data_disk_size = 100 + image_type_name = "Ubuntu-Focal-20.04" + image_type_uuid = "75c23040-2be7-49e9-8029-a16dc9f755d1" + } +} + +variable "mongodb_vol_ip" { + default = "" +} diff --git a/openstack-tf/modules/orientdb/orientdb.tf b/openstack-tf/modules/orientdb/orientdb.tf index 0ba86472..5022def7 100644 --- a/openstack-tf/modules/orientdb/orientdb.tf +++ b/openstack-tf/modules/orientdb/orientdb.tf @@ -220,7 +220,7 @@ resource "openstack_networking_secgroup_rule_v2" "access_to_orient_from_clients" direction = "ingress" ethertype = "IPv4" protocol = "tcp" - remote_ip_prefix = each.key + remote_ip_prefix = each.value } resource "openstack_networking_secgroup_rule_v2" "access_to_orient_from_haproxy" { for_each = toset( [var.basic_services_ip.haproxy_l7_1_cidr, var.basic_services_ip.haproxy_l7_2_cidr]) @@ -231,7 +231,7 @@ resource "openstack_networking_secgroup_rule_v2" "access_to_orient_from_haproxy" direction = "ingress" ethertype = "IPv4" protocol = "tcp" - remote_ip_prefix = each.key + remote_ip_prefix = each.value } # OrientDB for the Smart Executor nodes @@ -250,7 +250,7 @@ resource "openstack_networking_secgroup_rule_v2" "access_to_orient_se_from_clien direction = "ingress" ethertype = "IPv4" protocol = "tcp" - remote_ip_prefix = each.key + remote_ip_prefix = each.value } resource "openstack_networking_secgroup_rule_v2" "access_to_orient_se_from_haproxy" { for_each = toset( [var.basic_services_ip.haproxy_l7_1_cidr, var.basic_services_ip.haproxy_l7_2_cidr]) @@ -261,7 +261,7 @@ resource "openstack_networking_secgroup_rule_v2" "access_to_orient_se_from_hapro direction = "ingress" ethertype = "IPv4" protocol = "tcp" - remote_ip_prefix = each.key + remote_ip_prefix = each.value } # diff --git a/openstack-tf/modules/timescaledb/timescaledb.tf b/openstack-tf/modules/timescaledb/timescaledb.tf new file mode 100644 index 00000000..e33e620c --- /dev/null +++ b/openstack-tf/modules/timescaledb/timescaledb.tf @@ -0,0 +1,93 @@ +# TimeScaleDB shared server +# Network +resource "openstack_networking_network_v2" "timescaledb_net" { + name = var.timescaledb_server_data.network_name + admin_state_up = "true" + external = "false" + description = var.timescaledb_server_data.network_description + dns_domain = var.dns_zone.zone_name + mtu = var.mtu_size + port_security_enabled = true + shared = false + region = var.main_region +} + +# Subnet +resource "openstack_networking_subnet_v2" "timescaledb_subnet" { + name = "timescaledb-subnet" + description = "subnet used to connect to the shared TimeScaleDB service" + network_id = openstack_networking_network_v2.timescaledb_net.id + cidr = var.timescaledb_server_data.network_cidr + dns_nameservers = var.resolvers_ip + ip_version = 4 + enable_dhcp = true + no_gateway = true + allocation_pool { + start = var.timescaledb_server_data.allocation_pool_start + end = var.timescaledb_server_data.allocation_pool_end + } +} + +# Security group +resource "openstack_networking_secgroup_v2" "timescaledb_access" { + name = "access_to_the_timescaledb_service" + delete_default_rules = "true" + description = "Access the shared TimeScaleDB service using the dedicated network" +} + +resource "openstack_networking_secgroup_rule_v2" "timescaledb_access_from_dedicated_subnet" { + security_group_id = openstack_networking_secgroup_v2.timescaledb_access.id + description = "Allow connections to port 5432 from the 192.168.11.0/24 network" + direction = "ingress" + ethertype = "IPv4" + protocol = "tcp" + port_range_min = 5432 + port_range_max = 5432 + remote_ip_prefix = var.timescaledb_server_data.network_cidr +} + +resource "openstack_compute_servergroup_v2" "timescaledb_cluster" { + name = "timescaledb_cluster" + policies = ["soft-anti-affinity"] +} + +# Instances with an additional block device +resource "openstack_compute_instance_v2" "timescaledb_server" { + count = var.timescaledb_machines_count + name = var.timescaledb_server_data.name + availability_zone_hints = var.availability_zones_names.availability_zone_no_gpu + flavor_name = var.timescaledb_server_data.flavor + key_pair = var.ssh_key_file.name + security_groups = [var.default_security_group_name,openstack_networking_secgroup_v2.timescaledb_access.name] + scheduler_hints { + group = openstack_compute_servergroup_v2.timescaledb_cluster.id + } + block_device { + uuid = var.ubuntu_2204.uuid + source_type = "image" + volume_size = 10 + boot_index = 0 + destination_type = "volume" + delete_on_termination = false + } + + block_device { + source_type = "blank" + volume_size = var.timescaledb_data.node_data_disk_size + boot_index = -1 + destination_type = "volume" + delete_on_termination = false + } + + network { + name = var.main_private_network.name + } + network { + name = var.timescaledb_server_data.network_name + fixed_ip_v4 = var.timescaledb_ip.*[count.index] + } + + user_data = "${file("${var.ubuntu2204_data_file}")}" + depends_on = [openstack_networking_subnet_v2.timescaledb_subnet] +} + diff --git a/openstack-tf/modules/timescaledb/variables-timescaledb.tf b/openstack-tf/modules/timescaledb/variables-timescaledb.tf new file mode 100644 index 00000000..145ded15 --- /dev/null +++ b/openstack-tf/modules/timescaledb/variables-timescaledb.tf @@ -0,0 +1,37 @@ +variable "timescaledb_data" { + type = map(string) + default = { + node_name = "timescaledb" + node_data_disk_size = 10 + node_data_disk_device = "/dev/vdb" + } +} + +variable "timescaledb_node_flavor" { + default = "" +} + +variable "timescaledb_nodes_count" { + default = 1 +} + +variable "timescaledb_ip" { + type = list(string) + default = [] +} + +variable "timescaledb_cidr" { + type = list(string) + default = [ ] +} + +variable "timescaledb_net" { + type = map(string) + default = { + network_name = "timescaledb-net" + network_description = "Network used by the Timescaledb cluster and to access the service" + network_cidr = "192.168.11.0/24" + allocation_pool_start = "192.168.11.20" + allocation_pool_end = "192.168.11.254" + } +}