Skip to content
Snippets Groups Projects
Commit 72ff347d authored by Bo-Chun Chen's avatar Bo-Chun Chen Committed by John-Paul Robinson
Browse files

Add compute-ops null-resource

Changing ohpc id and compute node id will trigger it
Will run node registration on ohpc node.
parent 98996fc2
No related branches found
No related tags found
No related merge requests found
......@@ -110,4 +110,26 @@ output "ohpc-ssh_host" {
# calls the outputs defined in the ood-instance module
output "ood-ssh_host" {
value = "${module.create-ood-instance.ssh_host}"
}
\ No newline at end of file
}
# compute node post provision
resource "null_resource" "compute_ops" {
triggers = {
ohpc_instance = module.create-ohpc-instance.id
compute_instances = join(",", module.nodes.id)
}
connection {
host = module.create-ohpc-instance.ssh_host
user = var.ohpc_user
private_key = file(var.ssh_private_key)
}
# compute node
provisioner "remote-exec" {
inline = [
for node, net in module.nodes.network:
"ansible-playbook -i /CRI_XCBC/hosts -l `hostname -s` -e \"{'node_name':'${node}', 'node_ip_v4':'${net[0].fixed_ip_v4}', 'node_mac':'${net[0].mac}'}\" /CRI_XCBC/site-ops.yaml -b -v"
]
}
}
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