@@ -138,7 +138,8 @@ variable "metadata" {
138
138
}
139
139
140
140
variable "inventory_groups" {
141
- type = list (string )
141
+ type = string
142
+ description = " comma-separated list of inventory groups, in addition to 'builder'"
142
143
default = []
143
144
}
144
145
@@ -157,6 +158,7 @@ variable "inventory_groups" {
157
158
variable "image_name_prefix" {
158
159
type = string
159
160
description = " Prefix for built image names"
161
+ # TODO: maybe we can just make this default to the first two parts of the source image name?
160
162
default = " openhpc"
161
163
}
162
164
@@ -171,7 +173,7 @@ source "openstack" "openhpc" {
171
173
flavor = var. flavor
172
174
use_blockstorage_volume = var. use_blockstorage_volume
173
175
volume_type = var. volume_type
174
- volume_size = contains (var. inventory_groups , " cuda" ) ? var. volume_size_cuda : var. volume_size
176
+ volume_size = contains (split ( " , " , var. inventory_groups ) , " cuda" ) ? var. volume_size_cuda : var. volume_size
175
177
metadata = var. metadata
176
178
instance_metadata = {ansible_init_disable = " true" }
177
179
networks = var. networks
@@ -206,7 +208,7 @@ build {
206
208
207
209
provisioner "ansible" {
208
210
playbook_file = " ${ var . repo_root } /ansible/fatimage.yml"
209
- groups = concat ([" builder" ], var. inventory_groups )
211
+ groups = concat ([" builder" ], split ( " , " , var. inventory_groups ) )
210
212
keep_inventory_file = true # for debugging
211
213
use_proxy = false # see https://www.packer.io/docs/provisioners/ansible#troubleshooting
212
214
extra_arguments = [
0 commit comments