|
@ -1,26 +1,27 @@ |
|
|
# Define CloudComp group number |
|
|
# Define CloudComp group number |
|
|
variable "group_number" { |
|
|
variable "group_number" { |
|
|
type = string |
|
|
type = string |
|
|
default = "20" |
|
|
|
|
|
|
|
|
default = "<number of your group here, private-cloud is only reachable via vpn>" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
## OpenStack credentials can be used in a more secure way by using |
|
|
## OpenStack credentials can be used in a more secure way by using |
|
|
## cloud.yaml from https://private-cloud.informatik.hs-fulda.de/project/api_access/clouds.yaml/ |
|
|
|
|
|
|
|
|
## cloud.yaml from https://private-cloud2.informatik.hs-fulda.de/project/api_access/clouds.yaml/ |
|
|
|
|
|
|
|
|
# or by using env vars exported from openrc here, |
|
|
# or by using env vars exported from openrc here, |
|
|
# e.g., using 'export TF_VAR_os_password=$OS_PASSWORD' |
|
|
# e.g., using 'export TF_VAR_os_password=$OS_PASSWORD' |
|
|
|
|
|
|
|
|
# Define OpenStack credentials, project config etc. |
|
|
# Define OpenStack credentials, project config etc. |
|
|
locals { |
|
|
locals { |
|
|
auth_url = "https://private-cloud.informatik.hs-fulda.de:5000/v3" |
|
|
|
|
|
|
|
|
auth_url = "https://10.32.4.182:5000/v3" |
|
|
user_name = "CloudComp${var.group_number}" |
|
|
user_name = "CloudComp${var.group_number}" |
|
|
user_password = "<password of your group here, private-cloud is only reachable via vpn>" |
|
|
user_password = "<password of your group here, private-cloud is only reachable via vpn>" |
|
|
tenant_name = "CloudComp${var.group_number}" |
|
|
tenant_name = "CloudComp${var.group_number}" |
|
|
#network_name = "CloudComp${var.group_number}-net" |
|
|
#network_name = "CloudComp${var.group_number}-net" |
|
|
router_name = "CloudComp${var.group_number}-router" |
|
|
router_name = "CloudComp${var.group_number}-router" |
|
|
image_name = "Ubuntu 20.04 - Focal Fossa - 64-bit - Cloud Based Image" |
|
|
|
|
|
|
|
|
image_name = "ubuntu-22.04-jammy-x86_64" |
|
|
flavor_name = "m1.small" |
|
|
flavor_name = "m1.small" |
|
|
region_name = "RegionOne" |
|
|
region_name = "RegionOne" |
|
|
|
|
|
dns_nameservers = [ "10.33.16.100" ] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
# Define OpenStack provider |
|
|
# Define OpenStack provider |
|
@ -29,7 +30,9 @@ required_version = ">= 0.14.0" |
|
|
required_providers { |
|
|
required_providers { |
|
|
openstack = { |
|
|
openstack = { |
|
|
source = "terraform-provider-openstack/openstack" |
|
|
source = "terraform-provider-openstack/openstack" |
|
|
version = ">= 1.47.0" |
|
|
|
|
|
|
|
|
# last version before 2.0.0, shows octavia/neutron lbaas deprecation warnings |
|
|
|
|
|
# "~> 1.54.1" |
|
|
|
|
|
version = ">= 2.0.0" |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -41,7 +44,8 @@ provider "openstack" { |
|
|
password = local.user_password |
|
|
password = local.user_password |
|
|
auth_url = local.auth_url |
|
|
auth_url = local.auth_url |
|
|
region = local.region_name |
|
|
region = local.region_name |
|
|
use_octavia = true |
|
|
|
|
|
|
|
|
# due to currenty missing valid certificate |
|
|
|
|
|
insecure = true |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -107,6 +111,7 @@ resource "openstack_networking_subnet_v2" "terraform-subnet-1" { |
|
|
name = "my-terraform-subnet-1" |
|
|
name = "my-terraform-subnet-1" |
|
|
network_id = openstack_networking_network_v2.terraform-network-1.id |
|
|
network_id = openstack_networking_network_v2.terraform-network-1.id |
|
|
cidr = "192.168.255.0/24" |
|
|
cidr = "192.168.255.0/24" |
|
|
|
|
|
dns_nameservers = local.dns_nameservers |
|
|
ip_version = 4 |
|
|
ip_version = 4 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -250,7 +255,7 @@ resource "openstack_lb_monitor_v2" "monitor_1" { |
|
|
# |
|
|
# |
|
|
########################################################################### |
|
|
########################################################################### |
|
|
resource "openstack_networking_floatingip_v2" "fip_1" { |
|
|
resource "openstack_networking_floatingip_v2" "fip_1" { |
|
|
pool = "public1" |
|
|
|
|
|
|
|
|
pool = "ext_net" |
|
|
port_id = openstack_lb_loadbalancer_v2.lb_1.vip_port_id |
|
|
port_id = openstack_lb_loadbalancer_v2.lb_1.vip_port_id |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|