From 37222d2b7496c982377e44c559dd18d1813cc345 Mon Sep 17 00:00:00 2001
From: Krish Moodbidri <krish94@uab.edu>
Date: Thu, 26 Oct 2023 14:56:50 -0500
Subject: [PATCH] add volume 'xdmod_queue_data_volume' and Enable Mount at
 '/data/xdmod/queues/'

---
 main.tf | 9 +++++++++
 vars.tf | 1 +
 2 files changed, 10 insertions(+)

diff --git a/main.tf b/main.tf
index ac4705f..7e79e7d 100644
--- a/main.tf
+++ b/main.tf
@@ -56,6 +56,7 @@ output "keypair_name" {
 
 data "openstack_networking_network_v2" "external_net" {name = var.external_network}
 data "openstack_blockstorage_volume_v2" "disk" {name = var.data_volume}
+data "openstack_blockstorage_volume_v2" "disk2" {name = var.xdmod_queue_data_volume}
 
 # runs the ohpc-instance module - creates ohpc instance using variables defined above
 # calls functions from dmz-network, import-keypair, and floating-ip-address modules to get values created there for use
@@ -155,6 +156,14 @@ provisioner "remote-exec" {
     ]
   }
 
+provisioner "remote-exec" {
+    inline = [
+      "sudo mount ${module.create-ohpc-instance.device}1 /data/xdmod/queues",
+      "sudo df -h",
+      "sudo systemctl restart mariadb",
+    ]
+  }
+
   # compute node registration on ohpc
   provisioner "remote-exec" {
     inline = [
diff --git a/vars.tf b/vars.tf
index 11d6185..e12b0af 100644
--- a/vars.tf
+++ b/vars.tf
@@ -26,6 +26,7 @@ variable "ohpc_user" {default = "centos"}
 variable "ood_user" {default = "centos"}
 variable "ssh_private_key" {default = "~/.ssh/id_rsa"}
 variable "data_volume" {default = ""}
+variable "xdmod_queue_data_volume" {default = "xdmod_queue_data_volume"}
 
 # variables for node creation module
 variable "image_compute" {default = "compute-v1"}
-- 
GitLab