Commit 50c3e9e6 authored by Ryan Jones's avatar Ryan Jones
Browse files

adding clusternet

parent 041276fa
......@@ -5,14 +5,14 @@ resource "openstack_compute_keypair_v2" "test-keypair" {
# creates dmznet
resource "openstack_networking_network_v2" "terraform" {
name = "dmznet"
name = "dmxnet"
admin_state_up = "true"
}
# creates dmzsubnet using the floating ip defined in datasources.tf to get the network id
# cidr is the subnet range (that subnet range and dns nameservers from the network create file in feat-openstack)
resource "openstack_networking_subnet_v2" "terraform" {
name = "dmzsubnet"
name = "dmxsubnet"
network_id = "${openstack_networking_network_v2.terraform.id}"
cidr = "192.168.100.0/24"
ip_version = 4
......@@ -21,7 +21,7 @@ resource "openstack_networking_subnet_v2" "terraform" {
# defines the router borderrouter using floating ip defined in datasources.tf to create the external network id
resource "openstack_networking_router_v2" "terraform" {
name = "borderrouter"
name = "router"
admin_state_up = "true"
external_network_id = "${data.openstack_networking_network_v2.terraform.id}"
}
......@@ -94,16 +94,30 @@ resource "openstack_compute_floatingip_associate_v2" "terraform" {
instance_id = "${openstack_compute_instance_v2.terraform.id}"
}
resource "openstack_networking_port_v2" "port_1" {
name = "port_1"
network_id = "${openstack_networking_network_v2.terraform2.id}"
admin_state_up = "true"
}
# creates clusternet
resource "openstack_networking_network_v2" "terraform" {
name = "clusternet"
resource "openstack_networking_network_v2" "terraform2" {
name = "cluster"
admin_state_up = "true"
}
# creates dmzsubnet using the instance id
# creates clustersubnet using the instance id
# cidr is the subnet range (that subnet range and dns nameservers from the network create file in feat-openstack)
resource "openstack_networking_subnet_v2" "terraform" {
name = "clustersubnet"
instance_id = "${openstack_compute_instance_v2.terraform.id}"
resource "openstack_networking_subnet_v2" "terraform2" {
name = "clustersub"
network_id = "${openstack_networking_port_v2.port_1.id}"
cidr = "10.1.1.0/24"
ip_version = 4
}
# defines the instance and network id using info defined above
resource "openstack_compute_interface_attach_v2" "terraform2" {
instance_id = "${openstack_compute_instance_v2.terraform.id}"
network_id = "${openstack_networking_port_v2.port_1.id}"
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment