187 lines
4.5 KiB
HCL
187 lines
4.5 KiB
HCL
# Define required providers
|
|
terraform {
|
|
required_version = ">= 0.14.0"
|
|
required_providers {
|
|
openstack = {
|
|
source = "terraform-provider-openstack/openstack"
|
|
# version = "~> 1.53.0"
|
|
}
|
|
}
|
|
}
|
|
|
|
provider "openstack" {
|
|
cloud = "ISTI-Cloud"
|
|
}
|
|
|
|
module "labs_common_variables" {
|
|
source = "../../modules/labs_common_variables"
|
|
}
|
|
# Main module
|
|
module "main_private_net_and_dns_zone" {
|
|
source = "../../modules/labs_private_net_and_dns_zone"
|
|
dns_zone = {
|
|
zone_name = "wn.cloud.isti.cnr.it."
|
|
email = "postmaster@isti.cnr.it"
|
|
description = "DNS primary zone for the WN project"
|
|
ttl = 8600
|
|
}
|
|
os_project_data = {
|
|
name = "wn-lab-cloud"
|
|
id = "3dbab8216c914cda82e677cde415e36b"
|
|
}
|
|
|
|
main_private_network = {
|
|
name = "wn-cloud-main"
|
|
description = "WN private network (use this as the main network)"
|
|
}
|
|
main_private_subnet = {
|
|
name = "wn-cloud-main-subnet"
|
|
description = "WN main private subnet"
|
|
cidr = "10.17.0.0/21"
|
|
gateway_ip = "10.17.0.1"
|
|
allocation_start = "10.17.1.1"
|
|
allocation_end = "10.17.7.254"
|
|
}
|
|
external_router = {
|
|
name = "wn-lab-cloud-external-router"
|
|
description = "WN main router"
|
|
}
|
|
default_firewall_rules_map = {
|
|
"ssh_from_isti_net" = {
|
|
description = "SSH from the ISTI network"
|
|
source = module.labs_common_variables.ssh_sources.isti_net_cidr
|
|
port_min = 22
|
|
port_max = 22
|
|
},
|
|
"ssh_from_s2i2s_vpn_1" = {
|
|
description = "SSH from the S2I2S VPN 1"
|
|
source = module.labs_common_variables.ssh_sources.s2i2s_vpn_1_cidr
|
|
port_min = 22
|
|
port_max = 22
|
|
},
|
|
"ssh_from_s2i2s_vpn_2" = {
|
|
description = "SSH from the S2I2S VPN 2"
|
|
source = module.labs_common_variables.ssh_sources.s2i2s_vpn_2_cidr
|
|
port_min = 22
|
|
port_max = 22
|
|
},
|
|
"http_from_everywhere" = {
|
|
description = "HTTP from everywhere"
|
|
source = "0.0.0.0/0"
|
|
port_min = 80
|
|
port_max = 80
|
|
},
|
|
"https_from_everywhere" = {
|
|
description = "HTTPS from everywhere"
|
|
source = "0.0.0.0/0"
|
|
port_min = 443
|
|
port_max = 443
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
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
|
|
}
|