diff --git a/main.tf b/main.tf index 4156d5b37668d0eb347a83232e1e975b45d871b5..c95d2c2cd8f849093eb79e9e6b66e942429db731 100644 --- a/main.tf +++ b/main.tf @@ -112,8 +112,10 @@ output "ood-ssh_host" { value = "${module.create-ood-instance.ssh_host}" } -# compute node post provision -resource "null_resource" "compute_ops" { +# compute node and ood post provision +# use single null_resource for serial provisioner runs to avoid race conditions +# that lead to inconsistent deploy successes. +resource "null_resource" "ops" { triggers = { ohpc_instance = module.create-ohpc-instance.id compute_instances = join(",", module.nodes.id) @@ -137,28 +139,8 @@ resource "null_resource" "compute_ops" { for node, net in module.nodes.network: "ansible-playbook -c local -i /CRI_XCBC/hosts -l `hostname -s` -e \"{'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 post provision -resource "null_resource" "ood_ops" { - triggers = { - ohpc_instance = module.create-ohpc-instance.id - } - - connection { - host = module.create-ohpc-instance.ssh_host - user = var.ohpc_user - private_key = file(var.ssh_private_key) - } - - # moves CRI_XCBC file into directory made above - provisioner "file" { - source = "CRI_XCBC" - destination = "/" - } - -# ood node + # ood node provisioner "remote-exec" { inline = [ for net in module.create-ood-instance.network: