diff --git a/main.tf b/main.tf index 32afcc6d2e5dfdbd94648209fadd714dd172025d..8fee4aed193c1f26ea603b33f8834ec85fc538e4 100644 --- a/main.tf +++ b/main.tf @@ -133,12 +133,12 @@ resource "null_resource" "ops" { } # compute node registration on ohpc - provisioner "remote-exec" { - inline = [ - for node, net in module.nodes.network: - "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" - ] - } +# provisioner "remote-exec" { +# inline = [ +# for node, net in module.nodes.network: +# "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" { diff --git a/ohpc-instance/main.tf b/ohpc-instance/main.tf index 4d1668c3adcdae8617468d2d08929dea787c77c6..0da561db0de29b3ecc5bd52dc7aa37acefc93234 100644 --- a/ohpc-instance/main.tf +++ b/ohpc-instance/main.tf @@ -49,7 +49,11 @@ resource "openstack_compute_instance_v2" "ohpc" { # Clone CRI_Cluster_Monitor repository - git clone https://github.com/eesaanatluri/CRI_Cluster_Monitor.git /CRI_Cluster_Monitor - EOF + + # Run Ansible playbook + runcmd: + - ansible-playbook -c local -i /CRI_XCBC/hosts -l `hostname -s` -e "{'cod_deploy':'false', 'compute_nodes':[{'name':'${var.ohpc_instance_name}', 'ip':'${var.internal_ip}', 'mac':'${mac_address}', 'vnfs':'', 'sockets':'1', 'corespersocket':'1'}]}" /CRI_XCBC/site-ops.yaml -b -v + EOF # defines the networks of the instance network {