From 0f57e53ad887e2fdc7e787a5c1ae07325b6f99e7 Mon Sep 17 00:00:00 2001 From: John-Paul Robinson <jpr@uab.edu> Date: Mon, 13 Apr 2020 13:24:12 -0500 Subject: [PATCH] Remove post instatiation actions from all node types Supporting as simple option for deploying a cluster of nodes that only deploys the defined image with no-post provisioning steps. Removes the user_data actions from the compute and gateway (ood) nodes. Removes provisioner actions from the master node (ohpc). --- main.tf | 19 ++++++------------- nodes/main.tf | 5 +---- ood-instance/main.tf | 5 +---- 3 files changed, 8 insertions(+), 21 deletions(-) diff --git a/main.tf b/main.tf index c95d2c2..2176013 100644 --- a/main.tf +++ b/main.tf @@ -127,23 +127,16 @@ resource "null_resource" "ops" { private_key = file(var.ssh_private_key) } - # moves CRI_XCBC file into directory made above - provisioner "file" { - source = "CRI_XCBC" - destination = "/" - } + # + # explore feature for simply cluster provisioning + # Ignore all provisioners for non-ohpc cluster + # - # compute node + # provisioners run on cluster master(node) node provisioner "remote-exec" { inline = [ 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"] + "echo DEBUG: empty provisioner action: ${node}"] } - # 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"] - } } diff --git a/nodes/main.tf b/nodes/main.tf index dfeeead..8a54e8c 100644 --- a/nodes/main.tf +++ b/nodes/main.tf @@ -27,10 +27,7 @@ resource "openstack_compute_instance_v2" "compute" { user_data = <<-EOF #cloud-config runcmd: - - [ bash, -xc, 'ethernet=$(cat /sys/class/net/eth0/address); nodename=$(hostname -s); sed -e "s/MY_HWADDR/$ethernet/" -e "s/MY_NODENAME/$nodename/" -i /warewulf/config;' ] - - [ bash, -xc, "echo $(date) ': hello world!'; until WWGETFILES_INTERVAL=0 bash -x /warewulf/bin/wwgetfiles; do echo waiting ; rm -f /tmp/.wwgetfile.lock ; sleep 10; done;" ] - - [ bash, -xc, "systemctl restart munge" ] - - [ bash, -xc, "systemctl restart slurmd" ] + - [ bash, -xc, 'echo DEBUG: empty user_data var: add post instantiation steps here' ] EOF # defines the networks of the instance diff --git a/ood-instance/main.tf b/ood-instance/main.tf index a6a4419..5ff7e13 100644 --- a/ood-instance/main.tf +++ b/ood-instance/main.tf @@ -31,10 +31,7 @@ resource "openstack_compute_instance_v2" "ood" { user_data = <<-EOF #cloud-config runcmd: - - [ bash, -xc, 'ethernet=$(cat /sys/class/net/eth1/address); nodename=$(hostname -s); sed -e "s/MY_HWADDR/$ethernet/" -e "s/MY_NODENAME/$nodename/" -i /warewulf/config;' ] - - [ bash, -xc, "until WWGETFILES_INTERVAL=0 bash -x /warewulf/bin/wwgetfiles; do echo waiting ; rm -f /tmp/.wwgetfile.lock ; sleep 10; done;" ] - - [ bash, -xc, "systemctl restart munge" ] - - [ bash, -xc, "cd /CRI_XCBC; ansible-playbook -c local -i /CRI_XCBC/hosts -l `hostname -s` /CRI_XCBC/ood-ops.yaml -b -v" ] + - [ bash, -xc, 'echo DEBUG: empty user_data var: add post instantiation steps here' ] EOF -- GitLab