Skip to content

Commit 422f6a4

Browse files
authored
Merge branch 'main' into feat/packer-manifest-path
2 parents aff37d3 + 6680549 commit 422f6a4

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

packer/openstack.pkr.hcl

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,32 @@ variable "manifest_output_path" {
106106
default = "packer-manifest.json"
107107
}
108108

109+
variable "use_blockstorage_volume" {
110+
type = bool
111+
default = false
112+
}
113+
114+
variable "volume_size" {
115+
type = number
116+
default = null # When not specified use the size of the builder instance root disk
117+
}
118+
119+
variable "image_disk_format" {
120+
type = string
121+
default = null # When not specified use the image default
122+
}
123+
124+
variable "metadata" {
125+
type = map(string)
126+
default = {}
127+
}
128+
109129
source "openstack" "openhpc" {
110130
flavor = "${var.flavor}"
131+
volume_size = "${var.volume_size}"
132+
use_blockstorage_volume = "${var.use_blockstorage_volume}"
133+
image_disk_format = "${var.image_disk_format}"
134+
metadata = "${var.metadata}"
111135
networks = "${var.networks}"
112136
ssh_username = "${var.ssh_username}"
113137
ssh_timeout = "20m"
@@ -126,7 +150,7 @@ build {
126150
name = "compute"
127151
source_image = "${var.source_image}"
128152
source_image_name = "${var.source_image_name}" # NB: must already exist in OpenStack
129-
image_name = "ohpc-${source.name}-${local.timestamp}-${substr(local.git_commit, 0, 8)}.qcow2" # also provides a unique legal instance hostname (in case of parallel packer builds)
153+
image_name = "ohpc-${source.name}-${local.timestamp}-${substr(local.git_commit, 0, 8)}" # also provides a unique legal instance hostname (in case of parallel packer builds)
130154
}
131155

132156
provisioner "ansible" {
@@ -151,7 +175,7 @@ build {
151175
floating_ip_network = "${var.floating_ip_network}"
152176
source_image = "${var.fatimage_source_image}"
153177
source_image_name = "${var.fatimage_source_image_name}" # NB: must already exist in OpenStack
154-
image_name = "${source.name}-${local.timestamp}-${substr(local.git_commit, 0, 8)}.qcow2" # similar to name from slurm_image_builder
178+
image_name = "${source.name}-${local.timestamp}-${substr(local.git_commit, 0, 8)}" # similar to name from slurm_image_builder
155179
}
156180

157181
provisioner "ansible" {

0 commit comments

Comments
 (0)