Skip to content
Snippets Groups Projects
Commit c8555724 authored by Ryan Jones's avatar Ryan Jones
Browse files

updated to add clusternet

parent 4ec5e6a5
No related branches found
No related tags found
No related merge requests found
......@@ -85,7 +85,7 @@ resource "openstack_compute_instance_v2" "terraform" {
# defines the instance id using info from datasources.tf
network {
uuid = "${openstack_networking_network_v2.terraform.id}"
}
}
}
# associates floating ip with the instance
......@@ -94,23 +94,17 @@ 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" "terraform2" {
name = "clusternet"
admin_state_up = "true"
}
# creates clustersubnet using the instance id
# creates clustersubnet
# cidr is the subnet range (that subnet range and dns nameservers from the network create file in feat-openstack)
resource "openstack_networking_subnet_v2" "terraform2" {
name = "clustersubnet"
network_id = "${openstack_networking_port_v2.port_1.id}"
network_id = "${openstack_networking_network_v2.terraform2.id}"
cidr = "10.1.1.0/24"
ip_version = 4
}
......@@ -118,6 +112,5 @@ resource "openstack_networking_subnet_v2" "terraform2" {
# 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}"
network_id = "${openstack_networking_network_v2.terraform2.id}"
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment