Fix the state in the dev environment.

This commit is contained in:
Andrea Dell'Amico 2023-12-13 19:40:16 +01:00
parent 2119ef9ac2
commit d3811d01ee
Signed by: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF
9 changed files with 663 additions and 63 deletions

View File

@ -10,7 +10,176 @@ required_version = ">= 0.14.0"
}
}
module "main-network" {
module "common_variables" {
source = "../../modules/common_variables"
}
# Main module
module "main_private_net_and_dns_zone" {
source = "../../modules/main_private_net_and_dns_zone"
dns_zone = {
zone_name = "cloud-dev.d4science.org."
email = "postmaster@isti.cnr.it"
description = "DNS primary zone for the d4s-dev-cloud project"
ttl = 8600
}
os_project_data = {
id = "e8f8ca72f30648a8b389b4e745ac83a9"
}
main_private_network = {
name = "d4s-dev-cloud-main"
description = "D4Science DEV private network (use this as the main network)"
}
main_private_subnet = {
name = "d4s-dev-cloud-sub"
description = "D4Science Production main private subnet"
cidr = "10.1.28.0/22"
gateway_ip = "10.1.28.1"
allocation_start = "10.1.28.30"
allocation_end = "10.1.31.254"
}
external_router = {
name = "d4s-dev-cloud-external-router"
description = "D4Science DEV main router"
}
}
output "dns_zone_id" {
value = module.main_private_net_and_dns_zone.dns_zone_id
}
output "main_private_network_id" {
value = module.main_private_net_and_dns_zone.main_private_network_id
}
output "main_subnet_network_id" {
value = module.main_private_net_and_dns_zone.main_subnet_network_id
}
output "external_gateway_ip" {
value = module.main_private_net_and_dns_zone.external_gateway_ip
}
# Module used
output "main_region" {
value = module.common_variables.main_region
}
output "external_network" {
value = module.common_variables.external_network
}
output "external_network_id" {
value = module.common_variables.external_network.id
}
output "floating_ip_pools" {
value = module.common_variables.floating_ip_pools
}
output "resolvers_ip" {
value = module.common_variables.resolvers_ip
}
output "mtu_size" {
value = module.common_variables.mtu_size
}
output "availability_zones_names" {
value = module.common_variables.availability_zones_names
}
output "availability_zone_no_gpu_name" {
value = module.common_variables.availability_zones_names.availability_zone_no_gpu
}
output "availability_zone_with_gpu_name" {
value = module.common_variables.availability_zones_names.availability_zone_with_gpu
}
output "ssh_sources" {
value = module.common_variables.ssh_sources
}
output "networks_with_d4s_services" {
value = module.common_variables.networks_with_d4s_services
}
output "ubuntu_1804" {
value = module.common_variables.ubuntu_1804
}
output "ubuntu_2204" {
value = module.common_variables.ubuntu_2204
}
output "centos_7" {
value = module.common_variables.centos_7
}
output "almalinux_9" {
value = module.common_variables.almalinux_9
}
output "ubuntu1804_data_file" {
value = module.common_variables.ubuntu1804_data_file
}
output "ubuntu2204_data_file" {
value = module.common_variables.ubuntu2204_data_file
}
output "el7_data_file" {
value = module.common_variables.el7_data_file
}
output "ssh_jump_proxy" {
value = module.common_variables.ssh_jump_proxy
}
output "internal_ca_data" {
value = module.common_variables.internal_ca_data
}
output "prometheus_server_data" {
value = module.common_variables.prometheus_server_data
}
output "shared_postgresql_server_data" {
value = module.common_variables.shared_postgresql_server_data
}
output "haproxy_l7_data" {
value = module.common_variables.haproxy_l7_data
}
output "resource_registry_addresses" {
value = module.common_variables.resource_registry_addresses
}
output "smartexecutor_addresses" {
value = module.common_variables.smartexecutor_addresses
}
#Added by Francesco
output "policy_list" {
value = module.common_variables.policy_list
}
#Added by Francesco
output "flavor_list" {
value = module.common_variables.flavor_list
}
#Added by Francesco
output "security_group_list" {
value = module.common_variables.security_group_list
}
#Added by Francesco
output "networks_list" {
value = module.common_variables.networks_list
}

View File

@ -0,0 +1 @@
../variables/outputs-dev.tf

View File

@ -1,24 +1,432 @@
{
"version": 4,
"terraform_version": "1.6.3",
"serial": 6,
"terraform_version": "1.6.5",
"serial": 8,
"lineage": "194691ec-f344-4bd2-98ae-cbd15e9c9cdf",
"outputs": {
"almalinux_9": {
"value": {
"name": "AlmaLinux-9.0-20220718",
"uuid": "541650fc-dd19-4f38-bb1d-7333ed9dd688"
},
"type": [
"map",
"string"
]
},
"availability_zone_no_gpu_name": {
"value": "cnr-isti-nova-a",
"type": "string"
},
"availability_zone_with_gpu_name": {
"value": "cnr-isti-nova-gpu-a",
"type": "string"
},
"availability_zones_names": {
"value": {
"availability_zone_no_gpu": "cnr-isti-nova-a",
"availability_zone_with_gpu": "cnr-isti-nova-gpu-a"
},
"type": [
"map",
"string"
]
},
"basic_services_ip": {
"value": {
"ca": "10.1.29.247",
"ca_cidr": "10.1.29.247/32",
"haproxy_l7_1": "10.1.28.50",
"haproxy_l7_1_cidr": "10.1.28.50/32",
"haproxy_l7_2": "10.1.30.241",
"haproxy_l7_2_cidr": "10.1.30.241/32",
"octavia_main": "10.1.28.227",
"octavia_main_cidr": "10.1.28.227/32",
"prometheus": "10.1.30.129",
"prometheus_cidr": "10.1.30.129/32",
"ssh_jump": "10.1.29.164",
"ssh_jump_cidr": "10.1.29.164/32"
},
"type": [
"map",
"string"
]
},
"centos_7": {
"value": {
"name": "CentOS-7",
"uuid": "f0187a99-64f6-462a-ab5f-ef52fe62f2ca"
},
"type": [
"map",
"string"
]
},
"default_security_group_name": {
"value": "default",
"type": "string"
},
"dns_zone": {
"value": {
"description": "DNS primary zone for the d4s-dev-cloud project",
"email": "postmaster@isti.cnr.it",
"ttl": "8600",
"zone_name": "cloud-dev.d4science.org."
},
"type": [
"map",
"string"
]
},
"dns_zone_id": {
"value": "cbae638a-9d99-44aa-946c-0f5ffb7fc488",
"type": "string"
},
"external_gateway_ip": {
"value": "146.48.31.109",
"el7_data_file": {
"value": "../../openstack_vm_data_scripts/el7.sh",
"type": "string"
},
"external_gateway_ip": {
"value": [
{
"ip_address": "146.48.31.109",
"subnet_id": "57f87509-4016-46fb-b8c3-25fca7f72ccb"
}
],
"type": [
"list",
[
"object",
{
"ip_address": "string",
"subnet_id": "string"
}
]
]
},
"external_network": {
"value": {
"id": "1d2ff137-6ff7-4017-be2b-0d6c4af2353b",
"name": "external-network"
},
"type": [
"map",
"string"
]
},
"external_network_id": {
"value": "1d2ff137-6ff7-4017-be2b-0d6c4af2353b",
"type": "string"
},
"external_router": {
"value": {
"description": "D4Science DEV main router",
"id": "2ae28c5f-036b-45db-bc9f-5bab8fa3e914",
"name": "d4s-dev-cloud-external-router"
},
"type": [
"map",
"string"
]
},
"flavor_list": {
"value": {
"c1_large": "c1.large",
"c1_medium": "c1.medium",
"c1_small": "c1.small",
"m1_large": "m1.large",
"m1_medium": "m1.medium",
"m1_xlarge": "m1.xlarge",
"m2_large": "m2.large",
"m2_medium": "m2.medium",
"m2_small": "m2.small"
},
"type": [
"map",
"string"
]
},
"floating_ip_pools": {
"value": {
"main_public_ip_pool": "external-network"
},
"type": [
"map",
"string"
]
},
"haproxy_l7_data": {
"value": {
"flavor": "m1.medium",
"haproxy_1": "haproxy-l7-1",
"haproxy_2": "haproxy-l7-2",
"name": "main-haproxy-l7",
"vm_count": "2"
},
"type": [
"map",
"string"
]
},
"internal_ca_data": {
"value": {
"flavor": "m1.small",
"name": "ca"
},
"type": [
"map",
"string"
]
},
"main_haproxy_l7_ip": {
"value": [
"10.1.28.50",
"10.1.30.241"
],
"type": [
"list",
"string"
]
},
"main_private_network": {
"value": {
"description": "D4Science DEV private network (use this as the main network)",
"name": "d4s-dev-cloud-main"
},
"type": [
"map",
"string"
]
},
"main_private_network_id": {
"value": "e0af5eba-f24a-4d0d-8184-bc654b980c4a",
"type": "string"
},
"main_private_subnet": {
"value": {
"allocation_end": "10.1.31.254",
"allocation_start": "10.1.28.30",
"cidr": "10.1.28.0/22",
"description": "D4Science DEV main private subnet",
"gateway_ip": "10.1.28.1",
"name": "d4s-dev-cloud-sub"
},
"type": [
"map",
"string"
]
},
"main_region": {
"value": "isti_area_pi_1",
"type": "string"
},
"main_subnet_network_id": {
"value": "2aa977f2-80b4-447c-a6b0-dfa06bf68751",
"type": "string"
},
"mtu_size": {
"value": 8942,
"type": "number"
},
"networks_list": {
"value": {
"orientdb": "orientdb-net",
"orientdb_se": "orientdb-se-net",
"shared_postgresql": "postgresql-srv-net",
"swarm": "swarm-nfs-net",
"timescaledb": "timescaledb-net"
},
"type": [
"map",
"string"
]
},
"networks_with_d4s_services": {
"value": {
"garr_ct1_net": "90.147.166.0/23",
"garr_na_net": "90.147.152.0/24",
"garr_pa1_net": "90.147.188.0/23",
"infrascience_net": "146.48.122.0/23",
"isti_net": "146.48.80.0/21",
"s2i2s_net": "146.48.28.0/22"
},
"type": [
"map",
"string"
]
},
"octavia_information": {
"value": {
"main_lb_description": "Main L4 load balancer for the D4Science DEV",
"main_lb_hostname": "main-lb",
"main_lb_name": "lb-dev-l4",
"octavia_flavor": "octavia_amphora-mvcpu-ha",
"octavia_flavor_id": "394988b5-6603-4a1e-a939-8e177c6681c7"
},
"type": [
"map",
"string"
]
},
"os_project_data": {
"value": {
"id": "e8f8ca72f30648a8b389b4e745ac83a9"
},
"type": [
"map",
"string"
]
},
"policy_list": {
"value": {
"affinity": "affinity",
"anti_affinity": "anti-affinity",
"soft_affinity": "soft-affinity",
"soft_anti_affinity": "soft-anti-affinity"
},
"type": [
"map",
"string"
]
},
"prometheus_server_data": {
"value": {
"flavor": "m1.medium",
"name": "prometheus",
"public_grafana_server_cidr": "146.48.122.132/32",
"vol_data_device": "/dev/vdb",
"vol_data_name": "prometheus-data",
"vol_data_size": "100"
},
"type": [
"map",
"string"
]
},
"resolvers_ip": {
"value": [
"146.48.29.97",
"146.48.29.98",
"146.48.29.99"
],
"type": [
"list",
"string"
]
},
"resource_registry_addresses": {
"value": {},
"type": [
"map",
"string"
]
},
"security_group_list": {
"value": {
"acaland": "acaland's dev machine",
"access_to_orientdb": "access_to_orientdb",
"access_to_orientdb_se": "access_to_orientdb_se",
"access_to_the_timescaledb_service": "access_to_the_timescaledb_service",
"cassandra": "Cassandra",
"dataminer-publish": "dataminer-publish",
"debugging_from_jump_node": "debugging_from_jump_node",
"default": "default",
"docker_swarm": "Docker Swarm",
"docker_swarm_NFS": "Docker Swarm NFS",
"haproxy": "HAPROXY L7",
"http_and_https_from_the_load_balancers": "http and https from the load balancers",
"limited_HTTPS_access": "Limited HTTPS access",
"limited_SSH_access": "Limited SSH access",
"mongo": "mongo",
"orientdb_internal_docker_traffic": "orientdb_internal_docker_traffic",
"postgreSQL": "PostgreSQL service",
"public_HTTPS": "Public HTTPS"
},
"type": [
"map",
"string"
]
},
"shared_postgresql_server_data": {
"value": {
"allocation_pool_end": "192.168.3.254",
"allocation_pool_start": "192.168.0.100",
"flavor": "m1.medium",
"name": "shared-postgresql-server",
"network_cidr": "192.168.0.0/22",
"network_description": "Network used to communicate with the shared postgresql service",
"network_name": "postgresql-srv-net",
"server_cidr": "192.168.0.5/22",
"server_ip": "192.168.0.5",
"vol_data_device": "/dev/vdb",
"vol_data_name": "shared-postgresql-data",
"vol_data_size": "100"
},
"type": [
"map",
"string"
]
},
"smartexecutor_addresses": {
"value": {},
"type": [
"map",
"string"
]
},
"ssh_jump_proxy": {
"value": {
"flavor": "m2.small",
"name": "ssh-jump-proxy"
},
"type": [
"map",
"string"
]
},
"ssh_sources": {
"value": {
"d4s_vpn_1_cidr": "146.48.122.27/32",
"d4s_vpn_2_cidr": "146.48.122.49/32",
"infrascience_net_cidr": "146.48.122.0/23",
"s2i2s_vpn_1_cidr": "146.48.28.10/32",
"s2i2s_vpn_2_cidr": "146.48.28.11/32",
"shell_d4s_cidr": "146.48.122.95/32"
},
"type": [
"map",
"string"
]
},
"ubuntu1804_data_file": {
"value": "../../openstack_vm_data_scripts/ubuntu1804.sh",
"type": "string"
},
"ubuntu2204_data_file": {
"value": "../../openstack_vm_data_scripts/ubuntu2204.sh",
"type": "string"
},
"ubuntu_1804": {
"value": {
"name": "Ubuntu-Bionic-18.04",
"user_data_file": "../../openstack_vm_data_scripts/ubuntu1804.sh",
"uuid": "7ed6a2cd-2b07-482e-8ce4-f018dff16c89"
},
"type": [
"map",
"string"
]
},
"ubuntu_2204": {
"value": {
"name": "Ubuntu-Jammy-22.04",
"user_data_file": "../../openstack_vm_data_scripts/ubuntu2204.sh",
"uuid": "54768889-8556-4be4-a2eb-82a4d9b34627"
},
"type": [
"map",
"string"
]
}
},
"resources": [
@ -47,7 +455,10 @@
"zone_id": "cbae638a-9d99-44aa-946c-0f5ffb7fc488"
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMCJ9"
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMCJ9",
"dependencies": [
"openstack_dns_zone_v2.primary_project_dns_zone"
]
}
]
},
@ -100,13 +511,7 @@
"port_security_enabled": true,
"qos_policy_id": "",
"region": "isti_area_pi_1",
"segments": [
{
"network_type": "geneve",
"physical_network": "",
"segmentation_id": 13667
}
],
"segments": [],
"shared": false,
"tags": [],
"tenant_id": "e8f8ca72f30648a8b389b4e745ac83a9",
@ -137,7 +542,12 @@
"timeouts": null
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwfSwic2NoZW1hX3ZlcnNpb24iOiIwIn0="
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwfSwic2NoZW1hX3ZlcnNpb24iOiIwIn0=",
"dependencies": [
"openstack_networking_network_v2.main-private-network",
"openstack_networking_router_v2.external-router",
"openstack_networking_subnet_v2.main-private-subnet"
]
}
]
},
@ -172,10 +582,14 @@
"tenant_id": "e8f8ca72f30648a8b389b4e745ac83a9",
"timeouts": null,
"value_specs": null,
"vendor_options": []
"vendor_options": [
{
"set_router_gateway_after_create": true
}
]
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwfSwic2NoZW1hX3ZlcnNpb24iOiIwIn0="
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwfX0="
}
]
},
@ -228,7 +642,10 @@
"value_specs": null
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwfSwic2NoZW1hX3ZlcnNpb24iOiIwIn0="
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwfSwic2NoZW1hX3ZlcnNpb24iOiIwIn0=",
"dependencies": [
"openstack_networking_network_v2.main-private-network"
]
}
]
}

View File

@ -0,0 +1 @@
../variables/variables-dev.tf

View File

@ -10,8 +10,6 @@ dns_zone = {
ttl = 8600
}
dns_zone_id = "cbae638a-9d99-44aa-946c-0f5ffb7fc488"
default_security_group_name = "default"
main_private_network = {
@ -34,16 +32,6 @@ external_router = {
id = "2ae28c5f-036b-45db-bc9f-5bab8fa3e914"
}
main_haproxy_l7_ip = ["10.1.28.50", "10.1.30.241"]
octavia_information = {
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"
}
basic_services_ip = {
ca = "10.1.29.247"
ca_cidr = "10.1.29.247/32"
@ -58,3 +46,13 @@ basic_services_ip = {
octavia_main = "10.1.28.227"
octavia_main_cidr = "10.1.28.227/32"
}
main_haproxy_l7_ip = ["10.1.28.50", "10.1.30.241"]
octavia_information = {
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"
}

View File

@ -2,6 +2,34 @@ output "os_project_data" {
value = var.os_project_data
}
output "main_haproxy_l7_ip" {
value = var.main_haproxy_l7_ip
output "dns_zone" {
value = var.dns_zone
}
output "default_security_group_name" {
value = "default"
}
output "main_private_network" {
value = var.main_private_network
}
output "main_private_subnet" {
value = var.main_private_subnet
}
output "external_router" {
value = var.external_router
}
output "basic_services_ip" {
value = var.basic_services_ip
}
output "main_haproxy_l7_ip" {
value = var.main_haproxy_l7_ip
}
output "octavia_information" {
value = var.octavia_information
}

View File

@ -16,11 +16,6 @@ variable "dns_zone" {
}
}
variable "dns_zone_id" {
# Set with the correct value after the setup is complete
default = ""
}
variable "default_security_group_name" {
default = "default"
}
@ -54,22 +49,6 @@ 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 = {
@ -87,3 +66,19 @@ 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"
}
}

View File

@ -10,6 +10,8 @@ dns_zone = {
ttl = 8600
}
default_security_group_name = "default_for_all"
main_private_network = {
name = "d4s-production-cloud-main"
description = "D4Science Production private network (use this as the main network)"

View File

@ -27,11 +27,6 @@ variable "main_private_network" {
}
}
variable "main_private_network_id" {
# Set with the correct value after the setup is complete
default = "020df98d-ae72-452a-b376-3b6dc289acac"
}
variable "main_private_subnet" {
type = map(string)
default = {
@ -44,17 +39,11 @@ variable "main_private_subnet" {
}
}
variable "main_private_subnet_id" {
# Set with the correct value after the setup is complete
default = "5d7b83ad-e058-4a3a-bfd8-d20ba6d42e1a"
}
variable "external_router" {
type = map(string)
default = {
name = "d4s-production-cloud-external-router"
description = "D4Science Production main router"
id = "cc26064a-bb08-4c0b-929f-d0cb39f934a3"
}
}