diff --git a/kdd/wp-ai4yb/main.tf b/kdd/wp-ai4yb/main.tf index 427fa33..9e740b3 100644 --- a/kdd/wp-ai4yb/main.tf +++ b/kdd/wp-ai4yb/main.tf @@ -76,7 +76,7 @@ module "dns_records_create" { dns_resources_map = { wp = { zone_id = data.terraform_remote_state.privnet_dns_router.outputs.dns_zone_id - name = join(".", ["wp-ai4yb", data.terraform_remote_state.privnet_dns_router.outputs.dns_zone.name]) + name = join(".", ["www-ai4yb", data.terraform_remote_state.privnet_dns_router.outputs.dns_zone.name]) description = "AI for your business Wordpress" ttl = 8600 type = "A" @@ -88,7 +88,7 @@ module "dns_records_create" { description = "PHPMyAdmin for the AI for your business Wordpress DB" ttl = 8600 type = "CNAME" - records = [join(".", ["wp-ai4yb", data.terraform_remote_state.privnet_dns_router.outputs.dns_zone.name])] + records = [join(".", ["www-ai4yb", data.terraform_remote_state.privnet_dns_router.outputs.dns_zone.name])] } } } diff --git a/kdd/wp-ai4yb/terraform.tfstate b/kdd/wp-ai4yb/terraform.tfstate index 527caa1..68a096d 100644 --- a/kdd/wp-ai4yb/terraform.tfstate +++ b/kdd/wp-ai4yb/terraform.tfstate @@ -1,7 +1,7 @@ { "version": 4, "terraform_version": "1.6.6", - "serial": 6, + "serial": 10, "lineage": "b3025fb1-c280-2fe4-f25e-4ff6c950c850", "outputs": {}, "resources": [ @@ -524,7 +524,7 @@ "default_for_all" ], "stop_before_destroy": false, - "tags": null, + "tags": [], "timeouts": null, "updated": "2024-03-14 18:33:07 +0000 UTC", "user_data": "094aad1c2a9d617fb2d4622557b2841486c0ecd7", @@ -553,14 +553,14 @@ "description": "AI for your business site", "dns_domain": "", "dns_name": "", - "fixed_ip": "", + "fixed_ip": "10.12.1.115", "id": "2805f6f7-8ed0-4418-8d24-438da7856773", "pool": "external-network", - "port_id": "", + "port_id": "39ed1b16-16bb-4c65-841c-b42400f8707e", "region": "isti_area_pi_1", "subnet_id": null, "subnet_ids": null, - "tags": null, + "tags": [], "tenant_id": "d6757d56e6e54ffe83a9701cc92af4c2", "timeouts": null, "value_specs": null @@ -587,7 +587,7 @@ "name": "phpadmin-ai4yb.kdd.cloud.isti.cnr.it.", "project_id": "d6757d56e6e54ffe83a9701cc92af4c2", "records": [ - "wp-ai4yb.kdd.cloud.isti.cnr.it." + "www-ai4yb.kdd.cloud.isti.cnr.it." ], "region": "isti_area_pi_1", "timeouts": null, @@ -609,8 +609,8 @@ "attributes": { "description": "AI for your business Wordpress", "disable_status_check": false, - "id": "9d29d051-9567-4af4-9ffe-87eb643fc90b/9b1efb2a-20ce-4e97-a61b-bfe8ca564608", - "name": "wp-ai4yb.kdd.cloud.isti.cnr.it.", + "id": "9d29d051-9567-4af4-9ffe-87eb643fc90b/aa89edff-62a8-494f-a8d6-7c0d7a8d2c2f", + "name": "www-ai4yb.kdd.cloud.isti.cnr.it.", "project_id": "d6757d56e6e54ffe83a9701cc92af4c2", "records": [ "146.48.30.172" diff --git a/modules/complete_infra_setup/complete_infra_setup_outputs.tf b/modules/complete_infra_setup/complete_infra_setup_outputs.tf new file mode 100644 index 0000000..b235288 --- /dev/null +++ b/modules/complete_infra_setup/complete_infra_setup_outputs.tf @@ -0,0 +1,40 @@ + +output "ssh_jump_proxy" { + value = var.ssh_jump_proxy +} + +output "internal_ca_data" { + value = var.internal_ca_data +} + +output "prometheus_server_data" { + value = var.prometheus_server_data +} + +output "shared_postgresql_server_data" { + value = var.shared_postgresql_server_data +} + +output "haproxy_l7_data" { + value = var.haproxy_l7_data +} + +output "octavia_information" { + value = var.octavia_information +} + +output "main_octavia_lb_name" { + value = var.main_octavia_lb_name +} + +output "main_octavia_lb_description" { + value = var.main_octavia_lb_description +} + +output "main_octavia_lb_hostname" { + value = var.main_octavia_lb_hostname +} + +output "main_octavia_lb_flavor" { + value = var.main_octavia_lb_flavor +} \ No newline at end of file diff --git a/modules/complete_infra_setup/complete_infra_setup_variables.tf b/modules/complete_infra_setup/complete_infra_setup_variables.tf new file mode 100644 index 0000000..bf150c6 --- /dev/null +++ b/modules/complete_infra_setup/complete_infra_setup_variables.tf @@ -0,0 +1,98 @@ + +variable "ssh_jump_proxy" { + type = map(string) + default = { + name = "ssh-jump-proxy" + flavor = "m2.small" + } +} + +variable "internal_ca_data" { + type = map(string) + default = { + name = "ca" + flavor = "m1.small" + } +} + +variable "prometheus_server_data" { + type = map(string) + default = { + name = "prometheus" + flavor = "m1.medium" + vol_data_name = "prometheus-data" + vol_data_size = "100" + vol_data_device = "/dev/vdb" + public_grafana_server_cidr = "146.48.28.103/32" + } +} + +variable "shared_postgresql_server_data" { + type = map(string) + default = { + name = "shared-postgresql-server" + flavor = "m1.large" + vol_data_name = "shared-postgresql-data" + vol_data_size = "100" + vol_data_device = "/dev/vdb" + network_name = "postgresql-srv-net" + network_description = "Network used to communicate with the shared postgresql service" + network_cidr = "192.168.0.0/22" + allocation_pool_start = "192.168.0.100" + allocation_pool_end = "192.168.3.254" + server_ip = "192.168.0.5" + server_cidr = "192.168.0.5/22" + } +} + +variable "haproxy_l7_data" { + type = map(string) + default = { + name = "main-haproxy-l7" + haproxy_1 = "haproxy-l7-1" + haproxy_2 = "haproxy-l7-2" + flavor = "m1.medium" + vm_count = "2" + haproxy1_server_ip = "192.168.253.5" + haproxy2_server_ip = "192.168.253.6" + haproxy1_cidr = "192.168.253.5/24" + haproxy2_cidr = "192.168.253.6/24" + } +} + +variable "main_octavia_lb_name" { + default = "" +} + +variable "main_octavia_lb_description" { + default = "" +} + +variable "main_octavia_lb_hostname" { + default = "octavia-main-lb" +} + +variable "main_octavia_lb_flavor" { + default = "octavia_amphora-mvcpu-ha" +} + +variable "octavia_information" { + type = map(string) + default = { + main_lb_name = var.main_octavia_lb_name + main_lb_description = var.main_octavia_lb_description + octavia_flavor = var.main_octavia_lb_flavor + octavia_flavor_id = "394988b5-6603-4a1e-a939-8e177c6681c7" + main_lb_hostname = var.main_octavia_lb_hostname + network_name = "octavia-main-haproxy-net" + network_description = "Network that veicolates the traffic from Octavia and the main load balancer" + subnet_name = "octavia-main-haproxy-net" + subnet_description = "Network that veicolates the traffic from Octavia and the main load balancer" + subnet_cidr = "192.168.253.0/24" + gateway_ip = "192.168.253.1" + allocation_pool_start = "192.168.253.100" + allocation_pool_end = "192.168.253.254" + external_router_name = "octavia_main_lb_router" + external_router_description = "Octavia Main LB router" + } +} diff --git a/s2i2s/main_net_dns_router/outputs.tf b/s2i2s/main_net_dns_router/outputs.tf new file mode 100644 index 0000000..adc28f7 --- /dev/null +++ b/s2i2s/main_net_dns_router/outputs.tf @@ -0,0 +1,104 @@ + +output "os_project_data" { + value = module.main_private_net_and_dns_zone.os_project_data +} + +output "dns_zone" { + value = module.main_private_net_and_dns_zone.dns_zone +} + +output "dns_zone_id" { + value = module.main_private_net_and_dns_zone.dns_zone_id +} + +output "main_private_network" { + value = module.main_private_net_and_dns_zone.main_private_network +} + +output "main_private_network_id" { + value = module.main_private_net_and_dns_zone.main_private_network_id +} + +output "main_subnet_network" { + value = module.main_private_net_and_dns_zone.main_subnet_network +} +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 +} + +output "main_region" { + value = module.labs_common_variables.main_region +} + +output "external_network" { + value = module.labs_common_variables.external_network +} + +output "external_network_id" { + value = module.labs_common_variables.external_network.id +} + +output "floating_ip_pools" { + value = module.labs_common_variables.floating_ip_pools + +} + +output "resolvers_ip" { + value = module.labs_common_variables.resolvers_ip +} + +output "mtu_size" { + value = module.labs_common_variables.mtu_size +} + +output "availability_zones_names" { + value = module.labs_common_variables.availability_zones_names +} + +output "availability_zone_no_gpu_name" { + value = module.labs_common_variables.availability_zones_names.availability_zone_no_gpu +} + +output "availability_zone_with_gpu_name" { + value = module.labs_common_variables.availability_zones_names.availability_zone_with_gpu +} + +output "ssh_sources" { + value = module.labs_common_variables.ssh_sources +} + +output "ubuntu_2204" { + value = module.labs_common_variables.ubuntu_2204 +} + +output "centos_7" { + value = module.labs_common_variables.centos_7 +} + +output "almalinux_9" { + value = module.labs_common_variables.almalinux_9 +} + +output "ubuntu2204_data_file" { + value = module.labs_common_variables.ubuntu2204_data_file +} + +output "el7_data_file" { + value = module.labs_common_variables.el7_data_file +} + +output "policy_list" { + value = module.labs_common_variables.policy_list +} + +output "flavor_list" { + value = module.labs_common_variables.flavor_list +} + +output "default_security_group_name" { + value = module.labs_common_variables.default_security_group_name +} diff --git a/s2i2s/variables/outputs-s2i2s.tf b/s2i2s/variables/outputs-s2i2s.tf new file mode 100644 index 0000000..f061be1 --- /dev/null +++ b/s2i2s/variables/outputs-s2i2s.tf @@ -0,0 +1,31 @@ +output "os_project_data" { + value = var.os_project_data +} + +output "default_security_group_name" { + value = "default_for_all" +} + +output "networks_list" { + value = var.networks_list +} + +output "basic_services_ip" { + value = var.basic_services_ip +} + +output "main_haproxy_l7_ip" { + value = var.main_haproxy_l7_ip +} + +output "security_group_list" { + value = var.security_group_list +} + +output "main_octavia_lb_name" { + value = var.main_octavia_lb_name +} + +output "main_octavia_lb_description" { + value = var.main_octavia_lb_description +} diff --git a/s2i2s/variables/variables-s2i2s.tf b/s2i2s/variables/variables-s2i2s.tf new file mode 100644 index 0000000..d941977 --- /dev/null +++ b/s2i2s/variables/variables-s2i2s.tf @@ -0,0 +1,77 @@ +variable "os_project_data" { + type = map(string) + default = { + id = "1b45adf388934758b56d0dfdb4bfacf3" + } +} + +variable "networks_list" { + type = map(string) + default = { + shared_postgresql = "postgresql-srv-net" + storage_nfs = "StorageNFS" + octavia_main_lb = "octavia-main-lb" + } +} + +variable "shared_postgresql_server_data" { + type = map(string) + default = { + name = "shared-postgresql-server" + flavor = "m1.large" + vol_data_name = "shared-postgresql-data" + vol_data_size = "100" + vol_data_device = "/dev/vdb" + network_name = "postgresql-srv-net" + network_description = "Network used to communicate with the shared postgresql service" + network_cidr = "192.168.0.0/22" + allocation_pool_start = "192.168.0.100" + allocation_pool_end = "192.168.3.254" + server_ip = "192.168.0.5" + server_cidr = "192.168.0.5/22" + } +} + +variable "basic_services_ip" { + type = map(string) + default = { + ca = "10.10.0.4" + ca_cidr = "10.10.0.4/32" + ssh_jump = "10.10.0.5" + ssh_jump_cidr = "10.10.0.5/32" + prometheus = "10.10.0.10" + prometheus_cidr = "10.10.0.10/32" + haproxy_l7_1 = "10.10.0.11" + haproxy_l7_1_cidr = "10.10.0.11/32" + haproxy_l7_2 = "10.10.0.12" + haproxy_l7_2_cidr = "10.10.0.12/32" + octavia_main = "10.10.0.20" + octavia_main_cidr = "10.10.0.20/32" + } +} + +variable "main_haproxy_l7_ip" { + type = list(string) + default = ["10.10.0.11", "10.10.0.12"] +} + +variable "security_group_list" { + type = map(string) + default = { + postgresql = "PostgreSQL service" + haproxy = "traffic_from_main_lb_to_haproxy_l7" + public_https = "Public HTTPS" + limited_SSH_access = "Limited SSH access" + docker_swarm = "Docker Swarm" + http_and_https_from_the_load_balancers = "traffic_from_the_main_load_balancers" + limited_HTTPS_access = "restricted_web_service" + } +} + +variable "main_octavia_lb_name" { + default = "s2i2s-cloud-l4-load-balancer" +} + +variable "main_octavia_lb_description" { + default = "Main L4 load balancer for the S2I2S services" +}