From eeba066a80483ea54c4274d66757a171b37bced1 Mon Sep 17 00:00:00 2001
From: Bo-Chun Louis Chen <louistw@uab.edu>
Date: Thu, 14 Sep 2023 15:04:41 -0500
Subject: [PATCH] Add variable for volume size

---
 openstack-compute/nodeimage.pkr.hcl | 2 +-
 openstack-compute/variables.pkr.hcl | 6 ++++++
 openstack-gpu/nodeimage.pkr.hcl     | 2 +-
 openstack-gpu/variables.pkr.hcl     | 6 ++++++
 openstack-ood/nodeimage.pkr.hcl     | 2 +-
 openstack-ood/variables.pkr.hcl     | 6 ++++++
 openstack/nodeimage.pkr.hcl         | 2 +-
 openstack/variables.pkr.hcl         | 6 ++++++
 8 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/openstack-compute/nodeimage.pkr.hcl b/openstack-compute/nodeimage.pkr.hcl
index 62fcac7..bf00471 100644
--- a/openstack-compute/nodeimage.pkr.hcl
+++ b/openstack-compute/nodeimage.pkr.hcl
@@ -10,7 +10,7 @@ source "openstack" "image" {
   image_auto_accept_members = var.auto_accept_members
   image_tags                = var.image_tags
   image_disk_format         = var.image_format
-  volume_size               = 20
+  volume_size               = var.volume_size
   flavor                    = var.flavor
   instance_name             = var.build_instance_name
   use_blockstorage_volume   = true
diff --git a/openstack-compute/variables.pkr.hcl b/openstack-compute/variables.pkr.hcl
index 6fb12ce..20efd64 100644
--- a/openstack-compute/variables.pkr.hcl
+++ b/openstack-compute/variables.pkr.hcl
@@ -82,3 +82,9 @@ variable "ssh_username" {
   default     = "centos"
   description = "The default username to use for SSH"
 }
+
+variable "volume_size" {
+  type        = number
+  default     = 20
+  description = "The default volume size for building iamge"
+}
\ No newline at end of file
diff --git a/openstack-gpu/nodeimage.pkr.hcl b/openstack-gpu/nodeimage.pkr.hcl
index b93897d..034ead0 100644
--- a/openstack-gpu/nodeimage.pkr.hcl
+++ b/openstack-gpu/nodeimage.pkr.hcl
@@ -10,7 +10,7 @@ source "openstack" "image" {
   image_auto_accept_members = var.auto_accept_members
   image_tags                = var.image_tags
   image_disk_format         = var.image_format
-  volume_size               = 20
+  volume_size               = var.volume_size
   flavor                    = var.flavor
   instance_name             = var.build_instance_name
   use_blockstorage_volume   = true
diff --git a/openstack-gpu/variables.pkr.hcl b/openstack-gpu/variables.pkr.hcl
index 4a0a662..f9614ec 100644
--- a/openstack-gpu/variables.pkr.hcl
+++ b/openstack-gpu/variables.pkr.hcl
@@ -82,3 +82,9 @@ variable "ssh_username" {
   default     = "centos"
   description = "The default username to use for SSH"
 }
+
+variable "volume_size" {
+  type        = number
+  default     = 20
+  description = "The default volume size for building iamge"
+}
\ No newline at end of file
diff --git a/openstack-ood/nodeimage.pkr.hcl b/openstack-ood/nodeimage.pkr.hcl
index 379d8ab..65caab7 100644
--- a/openstack-ood/nodeimage.pkr.hcl
+++ b/openstack-ood/nodeimage.pkr.hcl
@@ -10,7 +10,7 @@ source "openstack" "image" {
   image_auto_accept_members = var.auto_accept_members
   image_tags                = var.image_tags
   image_disk_format         = var.image_format
-  volume_size               = 20
+  volume_size               = var.volume_size
   flavor                    = var.flavor
   instance_name             = var.build_instance_name
   use_blockstorage_volume   = true
diff --git a/openstack-ood/variables.pkr.hcl b/openstack-ood/variables.pkr.hcl
index 488994d..5a6f608 100644
--- a/openstack-ood/variables.pkr.hcl
+++ b/openstack-ood/variables.pkr.hcl
@@ -82,3 +82,9 @@ variable "ssh_username" {
   default     = "centos"
   description = "The default username to use for SSH"
 }
+
+variable "volume_size" {
+  type        = number
+  default     = 20
+  description = "The default volume size for building iamge"
+}
\ No newline at end of file
diff --git a/openstack/nodeimage.pkr.hcl b/openstack/nodeimage.pkr.hcl
index 556ac42..cc4316d 100644
--- a/openstack/nodeimage.pkr.hcl
+++ b/openstack/nodeimage.pkr.hcl
@@ -10,7 +10,7 @@ source "openstack" "image" {
   image_auto_accept_members = var.auto_accept_members
   image_tags                = var.image_tags
   image_disk_format         = var.image_format
-  volume_size               = 20
+  volume_size               = var.volume_size
   flavor                    = var.flavor
   instance_name             = var.build_instance_name
   use_blockstorage_volume   = true
diff --git a/openstack/variables.pkr.hcl b/openstack/variables.pkr.hcl
index 674af41..ba10499 100644
--- a/openstack/variables.pkr.hcl
+++ b/openstack/variables.pkr.hcl
@@ -82,3 +82,9 @@ variable "ssh_username" {
   default     = "centos"
   description = "The default username to use for SSH"
 }
+
+variable "volume_size" {
+  type        = number
+  default     = 20
+  description = "The default volume size for building iamge"
+}
\ No newline at end of file
-- 
GitLab