Skip to content

Commit ed8f79b

Browse files
committed
enable control of 'extra' build image name
1 parent 3840baa commit ed8f79b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packer/openstack.pkr.hcl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ variable "groups" {
159159
}
160160
}
161161

162+
variable "extra_image_name" {
163+
type = string
164+
description = "Infix for 'extra' build image name"
165+
default = "extra"
166+
}
167+
162168
source "openstack" "openhpc" {
163169
# Build VM:
164170
flavor = var.flavor
@@ -187,19 +193,20 @@ source "openstack" "openhpc" {
187193
# Output image:
188194
image_disk_format = "qcow2"
189195
image_visibility = var.image_visibility
190-
image_name = "${source.name}-${var.os_version}-${local.timestamp}-${substr(local.git_commit, 0, 8)}"
191196
}
192197

193198
build {
194199

195200
# non-OFED fat image:
196201
source "source.openstack.openhpc" {
197202
name = "openhpc"
203+
image_name = "${source.name}-${var.os_version}-${local.timestamp}-${substr(local.git_commit, 0, 8)}"
198204
}
199205

200206
# OFED fat image:
201207
source "source.openstack.openhpc" {
202208
name = "openhpc-ofed"
209+
image_name = "${source.name}-${var.os_version}-${local.timestamp}-${substr(local.git_commit, 0, 8)}"
203210
}
204211

205212
# CUDA fat image:
@@ -210,6 +217,7 @@ build {
210217
# Extended site-specific image, built on fat image:
211218
source "source.openstack.openhpc" {
212219
name = "openhpc-extra"
220+
image_name = "openhpc-${var.extra_image_name}-${var.os_version}-${local.timestamp}-${substr(local.git_commit, 0, 8)}"
213221
}
214222

215223
provisioner "ansible" {

0 commit comments

Comments
 (0)