infrastructure-as-code/openstack-tf/modules/common_variables/variables.tf

381 lines
9.2 KiB
HCL

# 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"
}
}
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 "dns_zone" {
type = map(string)
default = {
zone_name = ""
email = "postmaster@isti.cnr.it"
description = ""
ttl = 8600
id = ""
}
}
variable "dns_zone_id" {
# Set with the correct value after the setup is complete
default = ""
}
variable "main_private_network" {
type = map(string)
default = {
name = ""
description = ""
}
}
variable "main_private_network_id" {
# Set with the correct value after the setup is complete
default = ""
}
variable "main_private_subnet" {
type = map(string)
default = {
name = ""
description = ""
cidr = ""
gateway_ip = ""
allocation_start = ""
allocation_end = ""
}
}
variable "main_private_subnet_id" {
# Set with the correct value after the setup is complete
default = ""
}
variable "external_router" {
type = map(string)
default = {
name = ""
description = ""
id = ""
}
}
variable "ubuntu_1804" {
type = map(string)
default = {
name = "Ubuntu-Bionic-18.04"
uuid = "7ed6a2cd-2b07-482e-8ce4-f018dff16c89"
user_data_file = "../../openstack_vm_data_scripts/ubuntu1804.sh"
}
}
variable "ubuntu_2204" {
type = map(string)
default = {
name = "Ubuntu-Jammy-22.04"
uuid = "54768889-8556-4be4-a2eb-82a4d9b34627"
user_data_file = "../../openstack_vm_data_scripts/ubuntu2204.sh"
}
}
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"
}
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.122.132/32"
}
}
variable "shared_postgresql_server_data" {
type = map(string)
default = {
name = "shared-postgresql-server"
flavor = "m1.medium"
vol_data_name = "shared-postgresql-data"
vol_data_size = "100"
vol_data_device = "/dev/vdb"
# vol_backup_name = ""
# vol_backup_size = ""
# vol_backup_device = ""
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"
}
}
variable "resource_registry_addresses" {
type = map(string)
default = {
}
}
variable "smartexecutor_addresses" {
type = map(string)
default = {
}
}
variable "os_project_data" {
type = map(string)
default = {
id = ""
}
}
variable "default_security_group_name" {
default = "default_for_all"
}
variable "basic_services_ip" {
type = map(string)
default = {
ca = ""
ca_cidr = ""
ssh_jump = ""
ssh_jump_cidr = ""
prometheus = ""
prometheus_cidr = ""
haproxy_l7_1 = ""
haproxy_l7_1_cidr = ""
haproxy_l7_2 = ""
haproxy_l7_2_cidr = ""
octavia_main = ""
octavia_main_cidr = ""
}
}
variable "main_haproxy_l7_ip" {
type = list(string)
default = []
}
variable "octavia_information" {
type = map(string)
default = {
main_lb_name = ""
main_lb_description = ""
swarm_lb_name = ""
octavia_flavor = ""
octavia_flavor_id = ""
main_lb_hostname = ""
# The following aren't available when the module runs so we have to get them with the command
# openstack --os-cloud d4s-pre port list -f value | grep octavia-lb-vrrp
# This means that the execution will fail
octavia_vrrp_ip_1 = ""
octavia_vrrp_ip_2 = ""
}
}
# Added by Francesco
# Create in the path 'modules/ssh-key-ref' the file 'ssh-key-ref-outputs.tf'
# with the following outputs:
# output "ssh_key_file" {
# value = "~/.ssh/{YOUR_PRIVATE_KEYNAME}"
# sensitive = true
# }
# output "ssh_key_name" {
# value = "{YOUR_KEYNAME}"
# sensitive = false
# }
# Then you can use above outputs in your 'file.tf' (if it contains the soft link to variables.tf) as:
# module.ssh_settings.ssh_key_file
# module.ssh_settings.ssh_key_name
# e.g.
#
# resource "openstack_compute_instance_v2" "geoserver" {
# key_pair = module.ssh_settings.ssh_key_name
module "ssh_settings" {
source = "../../modules/ssh-key-ref"
}
# Added by Francesco
variable "flavor_list" {
type = map(string)
default = {
c1_small = "c1.small" #RAM 2 - VCPUs 2
c1_medium = "c1.medium" #RAM 4 - VCPUs 4
c1_large = "c1.large" #RAM 8 - VCPUs 8
m1_medium = "m1.medium" #RAM 4 - VCPUs 2
m1_large = "m1.large" #RAM 8 - VCPUs 4
m1_xlarge = "m1.xlarge" #RAM 16 - VCPUs 8
m2_small = "m2.small" #RAM 8 - VCPUs 2
m2_medium = "m2.medium" #RAM 16 - VCPUs 4
m2_large = "m2.large" #RAM 32 - VCPUs 8
}
}
# Added by Francesco
variable "security_group_list" {
type = map(string)
default = {
postgreSQL = "PostgreSQL service"
acaland = "acaland's dev machine"
haproxy = "HAPROXY L7"
access_to_orientdb = "access_to_orientdb"
dataminer-publish = "dataminer-publish"
docker_swarm_NFS = "Docker Swarm NFS"
public_HTTPS = "Public HTTPS"
haproxy = "HAPROXY L7"
orientdb_internal_docker_traffic = "orientdb_internal_docker_traffic"
limited_SSH_access = "Limited SSH access"
access_to_the_timescaledb_service = "access_to_the_timescaledb_service"
docker_swarm = "Docker Swarm"
http_and_https_from_the_load_balancers = "http and https from the load balancers"
limited_HTTPS_access = "Limited HTTPS access"
mongo = "mongo"
limited_SSH_access = "Limited SSH access"
default = "default"
cassandra = "Cassandra"
access_to_orientdb_se = "access_to_orientdb_se"
}
}
# Added by Francesco
variable "policy_list" {
type = map(string)
default = {
soft_anti_affinity = "soft-anti-affinity"
anti_affinity = "anti-affinity"
affinity = "affinity"
soft_affinity = "soft-affinity"
}
}
variable "networks_list" {
type = map(string)
default = {
shared_postgresql = "postgresql-srv-net"
swarm = "swarm-nfs-net"
timescaledb = "timescaledb-net"
orientdb = "orientdb-net"
orientdb_se = "orientdb-se-net"
}
}