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

Include mount commands in user_data_script for Terraform instance initialization

This commit updates the user_data_script in the Terraform script to include mount commands for better initialization of the instance. The added mount commands ensure proper mounting of specified devices to relevant directories during the first boot of the instance. This adjustment addresses the requirement for mounting operations in the infrastructure setup.
parent d8a0938c
No related branches found
No related tags found
No related merge requests found
Pipeline #9787 failed with stages
in 26 seconds
...@@ -14,6 +14,21 @@ provider "openstack" { ...@@ -14,6 +14,21 @@ provider "openstack" {
} }
} }
variable "user_data_script" {
description = "User data script to be executed during instance initialization"
type = string
default = <<-EOF
#!/bin/bash
sudo mkdir -p /data/xdmod/queues
sudo mount ${module.create-ohpc-instance.device[0]}1 /var/lib/mysql
sudo df -h
sudo systemctl restart mariadb
sudo sed -i -E 's/xdmod..nip.io/xdmod.rc.uab.edu/g' /etc/httpd/conf.d/xdmod.conf
sudo sed -i -E 's/xdmod..nip.io/xdmod.rc.uab.edu/g' /etc/xdmod/simplesamlphp/config/config.php
sudo systemctl restart httpd
EOF
}
# runs the internal-network module # runs the internal-network module
module "cluster-network" { module "cluster-network" {
internal_net = var.internal_network internal_net = var.internal_network
...@@ -72,6 +87,7 @@ module "create-ohpc-instance" { ...@@ -72,6 +87,7 @@ module "create-ohpc-instance" {
ohpc_user = var.ohpc_user ohpc_user = var.ohpc_user
ssh_private_key = var.ssh_private_key ssh_private_key = var.ssh_private_key
vol_id = data.openstack_blockstorage_volume_v3.disk.id vol_id = data.openstack_blockstorage_volume_v3.disk.id
user_data_script = var.user_data_script
} }
# runs the ood-instance module - creates ood instance using variables defined above # runs the ood-instance module - creates ood instance using variables defined above
......
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