Add variables in a more dynamic way

Some reformatting on some of the files
This commit is contained in:
Arif Ali 2023-07-10 23:13:55 +01:00
parent 828d4a6ff4
commit e54d63390c
Signed by: arif
GPG Key ID: 369608FBA1353A70
6 changed files with 27 additions and 13 deletions

View File

@ -9,10 +9,15 @@ terraform {
}
provider "openstack" {
cloud = "arif-home"
cloud = var.cloud
}
variable "domain_id" {
type = string
default = "3fd5a53e08e243b49ac3b171d57b4e4a"
type = string
default = ""
}
variable "cloud" {
type = string
default = ""
}

View File

@ -0,0 +1,2 @@
cloud = "arif-home"
domain_id = "3fd5a53e08e243b49ac3b171d57b4e4a"

View File

@ -0,0 +1 @@
../arif-home.tfvars

View File

@ -0,0 +1 @@
../arif-home.tfvars

View File

@ -1,29 +1,33 @@
resource "openstack_networking_network_v2" "ext_net" {
name = "ext_net"
admin_state_up = "true"
admin_state_up = true
shared = true
external = true
segments {
physical_network = "physnet1"
network_type = "flat"
network_type = "flat"
}
}
resource "openstack_networking_subnet_v2" "ext_net_subnet" {
name = "ext_net_subnet"
network_id = openstack_networking_network_v2.ext_net.id
cidr = "192.168.1.0/24"
gateway_ip = "192.168.1.254"
name = "ext_net_subnet"
network_id = openstack_networking_network_v2.ext_net.id
cidr = "192.168.1.0/24"
gateway_ip = "192.168.1.254"
enable_dhcp = false
ip_version = 4
dns_nameservers = ["192.168.1.9","192.168.1.13"]
ip_version = 4
dns_nameservers = [
"192.168.1.9",
"192.168.1.13"
]
allocation_pool {
start = "192.168.1.42"
end = "192.168.1.79"
end = "192.168.1.79"
}
}
@ -46,7 +50,7 @@ resource "openstack_networking_subnet_v2" "private_subnet" {
allocation_pool {
start = "192.168.21.2"
end = "192.168.21.254"
end = "192.168.21.254"
}
}

View File

@ -0,0 +1 @@
../arif-home.tfvars