@@ -138,8 +138,9 @@ variable "metadata" {
138138}
139139
140140variable "inventory_groups" {
141- type = list (string )
142- default = []
141+ type = string
142+ description = " comma-separated list of inventory groups, in addition to 'builder'"
143+ default = ''
143144}
144145
145146# variable "groups" {
@@ -157,6 +158,7 @@ variable "inventory_groups" {
157158variable "image_name_prefix" {
158159 type = string
159160 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?
160162 default = " openhpc"
161163}
162164
@@ -171,7 +173,7 @@ source "openstack" "openhpc" {
171173 flavor = var. flavor
172174 use_blockstorage_volume = var. use_blockstorage_volume
173175 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
175177 metadata = var. metadata
176178 instance_metadata = {ansible_init_disable = " true" }
177179 networks = var. networks
@@ -206,7 +208,7 @@ build {
206208
207209 provisioner "ansible" {
208210 playbook_file = " ${ var . repo_root } /ansible/fatimage.yml"
209- groups = concat ([" builder" ], var. inventory_groups )
211+ groups = concat ([" builder" ], split ( " , " , var. inventory_groups ) )
210212 keep_inventory_file = true # for debugging
211213 use_proxy = false # see https://www.packer.io/docs/provisioners/ansible#troubleshooting
212214 extra_arguments = [
0 commit comments