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

Add user data in compute node provision

Modify warewulf config file with compute node info
parent 87d3e5d1
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,14 @@ resource "openstack_compute_instance_v2" "compute" {
key_pair = var.key_pair
security_groups = ["default"]
count = var.compute_node_count
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" ]
EOF
# defines the networks of the instance
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