Skip to content
Snippets Groups Projects

Feat trim tf deploy

Open Eesaan Atluri requested to merge feat-trim-tf-deploy into master
+ 1
50
@@ -38,10 +38,6 @@ output "floating_ip_ohpc" {
@@ -38,10 +38,6 @@ output "floating_ip_ohpc" {
value = module.floating-ip-address.ohpc_address
value = module.floating-ip-address.ohpc_address
}
}
#output "floating_ip_ood" {
# value = module.floating-ip-address.ood_address
#}
# runs the key-pair module - imports local public key into openstack and give it the name defined above in the variables
# runs the key-pair module - imports local public key into openstack and give it the name defined above in the variables
module "import-keypair" {
module "import-keypair" {
source = "./key-pair"
source = "./key-pair"
@@ -74,35 +70,6 @@ module "create-ohpc-instance" {
@@ -74,35 +70,6 @@ module "create-ohpc-instance" {
vol_id = data.openstack_blockstorage_volume_v2.disk.id
vol_id = data.openstack_blockstorage_volume_v2.disk.id
}
}
# runs the ood-instance module - creates ood instance using variables defined above
# calls functions from cluster-network, import-keypair, and floating-ip-address modules to get values created there for use
#module "create-ood-instance" {
# internal_subnet_id = module.cluster-network.internal_subnet_id
# source = "./ood-instance"
# ood_instance_name = var.ood_instance_name
# image_ood = var.image_ood
# flavor = var.flavor
# key_pair = module.import-keypair.keypair_name
# internal_network = var.internal_network
# external_network = var.external_network
# floating_ip_ood = module.floating-ip-address.ood_address
# host_prefix = var.host_prefix
# ood_user = var.ood_user
# ssh_private_key = var.ssh_private_key
#}
# runs the nodes module - creates nodes using variables defined above
# calls functions from cluster-network and import-keypair modules to get values created there for use
module "nodes" {
internal_subnet_id = "${module.cluster-network.internal_subnet_id}"
source = "./nodes"
image_compute = var.image_compute
flavor = var.flavor
key_pair = module.import-keypair.keypair_name
compute_node_count = var.compute_node_count
internal_network = "${module.cluster-network.internal_network_id}"
}
# calls the outputs defined in the ohpc-instance module
# calls the outputs defined in the ohpc-instance module
output "ohpc-ssh_host" {
output "ohpc-ssh_host" {
value = module.create-ohpc-instance.ssh_host
value = module.create-ohpc-instance.ssh_host
@@ -112,18 +79,11 @@ output "xdmod_instance_id" {
@@ -112,18 +79,11 @@ output "xdmod_instance_id" {
value = module.create-ohpc-instance.xdmod_instance_id
value = module.create-ohpc-instance.xdmod_instance_id
}
}
# calls the outputs defined in the ood-instance module
#output "ood-ssh_host" {
# value = module.create-ood-instance.ssh_host
#}
# compute node and ood post provision
# use single null_resource for serial provisioner runs to avoid race conditions
# use single null_resource for serial provisioner runs to avoid race conditions
# that lead to inconsistent deploy successes.
# that lead to inconsistent deploy successes.
resource "null_resource" "ops" {
resource "null_resource" "ops" {
triggers = {
triggers = {
ohpc_instance = module.create-ohpc-instance.xdmod_instance_id
ohpc_instance = module.create-ohpc-instance.xdmod_instance_id
compute_instances = join(",", module.nodes.id)
}
}
connection {
connection {
@@ -158,16 +118,7 @@ provisioner "remote-exec" {
@@ -158,16 +118,7 @@ provisioner "remote-exec" {
# compute node registration on ohpc
# compute node registration on ohpc
provisioner "remote-exec" {
provisioner "remote-exec" {
inline = [
inline = [
for node, net in module.nodes.network:
"ansible-playbook -c local -i /CRI_XCBC/hosts -l `hostname -s` -e \"{'cod_deploy':'false', /CRI_XCBC/site-ops.yaml -b -v"
"ansible-playbook -c local -i /CRI_XCBC/hosts -l `hostname -s` -e \"{'cod_deploy':'false', 'compute_nodes':[{'name':'${node}', 'ip':'${net[0].fixed_ip_v4}', 'mac':'${net[0].mac}', 'vnfs':'', 'sockets':'1', 'corespersocket':'1'}]}\" /CRI_XCBC/site-ops.yaml -b -v"
]
]
}
}
# ood node
# provisioner "remote-exec" {
# inline = [
# for net in module.create-ood-instance.network:
# "ansible-playbook -c local -i /CRI_XCBC/hosts -l `hostname -s` -e \"{'compute_nodes':[{'name':'${var.ood_instance_name}', 'ip':'${net.fixed_ip_v4}', 'mac':'${net.mac}', 'vnfs':'', 'sockets':'1', 'corespersocket':'1'}]}\" /CRI_XCBC/site-ops.yaml -b -v"]
# }
}
}
Loading