Skip to content
Snippets Groups Projects
Commit 3245d36a authored by Krish Moodbidri's avatar Krish Moodbidri
Browse files

Move Ansible Playbook Execution to OHPC Instance User Data

parent dda7b3fe
No related branches found
No related tags found
No related merge requests found
Pipeline #10053 failed with stages
in 26 seconds
...@@ -133,12 +133,12 @@ resource "null_resource" "ops" { ...@@ -133,12 +133,12 @@ resource "null_resource" "ops" {
} }
# 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: # 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" # "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 # ood node
# provisioner "remote-exec" { # provisioner "remote-exec" {
......
...@@ -49,7 +49,11 @@ resource "openstack_compute_instance_v2" "ohpc" { ...@@ -49,7 +49,11 @@ resource "openstack_compute_instance_v2" "ohpc" {
# Clone CRI_Cluster_Monitor repository # Clone CRI_Cluster_Monitor repository
- git clone https://github.com/eesaanatluri/CRI_Cluster_Monitor.git /CRI_Cluster_Monitor - 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 # defines the networks of the instance
network { network {
......
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