@@ -130,6 +130,11 @@ variable "volume_size" {
130
130
default = null # When not specified use the size of the builder instance root disk
131
131
}
132
132
133
+ variable "volume_size_ofed" {
134
+ type = number
135
+ default = null # When not specified use the size of the builder instance root disk
136
+ }
137
+
133
138
variable "image_disk_format" {
134
139
type = string
135
140
default = null # When not specified use the image default
@@ -141,22 +146,32 @@ variable "metadata" {
141
146
}
142
147
143
148
source "openstack" "openhpc" {
144
- flavor = " ${ var . flavor } "
145
- volume_size = " ${ var . volume_size } "
146
- use_blockstorage_volume = " ${ var . use_blockstorage_volume } "
149
+ # Build VM:
150
+ flavor = var. flavor
151
+ use_blockstorage_volume = var. use_blockstorage_volume
147
152
volume_type = var. volume_type
148
- image_disk_format = " ${ var . image_disk_format } "
149
- metadata = " ${ var . metadata } "
150
- networks = " ${ var . networks } "
151
- ssh_username = " ${ var . ssh_username } "
153
+ metadata = var. metadata
154
+ networks = var. networks
155
+ floating_ip_network = var. floating_ip_network
156
+ security_groups = var. security_groups
157
+
158
+ # Input image:
159
+ source_image = " ${ var . fatimage_source_image [var . os_version ]} "
160
+ source_image_name = " ${ var . fatimage_source_image_name [var . os_version ]} " # NB: must already exist in OpenStack
161
+
162
+ # SSH:
163
+ ssh_username = var. ssh_username
152
164
ssh_timeout = " 20m"
153
- ssh_private_key_file = " ${ var . ssh_private_key_file } " # TODO: doc same requirements as for qemu build?
154
- ssh_keypair_name = " ${ var . ssh_keypair_name } " # TODO: doc this
155
- ssh_bastion_host = " ${ var . ssh_bastion_host } "
156
- ssh_bastion_username = " ${ var . ssh_bastion_username } "
157
- ssh_bastion_private_key_file = " ${ var . ssh_bastion_private_key_file } "
158
- security_groups = " ${ var . security_groups } "
159
- image_visibility = " ${ var . image_visibility } "
165
+ ssh_private_key_file = var. ssh_private_key_file
166
+ ssh_keypair_name = var. ssh_keypair_name # TODO: doc this
167
+ ssh_bastion_host = var. ssh_bastion_host
168
+ ssh_bastion_username = var. ssh_bastion_username
169
+ ssh_bastion_private_key_file = var. ssh_bastion_private_key_file
170
+
171
+ # Output image:
172
+ image_disk_format = var. image_disk_format
173
+ image_visibility = var. image_visibility
174
+ image_name = " ${ source . name } -${ var . os_version } -${ local . timestamp } -${ substr (local. git_commit , 0 , 8 )} "
160
175
}
161
176
162
177
# "fat" image builds:
@@ -165,19 +180,13 @@ build {
165
180
# non-OFED:
166
181
source "source.openstack.openhpc" {
167
182
name = " openhpc"
168
- floating_ip_network = " ${ var . floating_ip_network } "
169
- source_image = " ${ var . fatimage_source_image [var . os_version ]} "
170
- source_image_name = " ${ var . fatimage_source_image_name [var . os_version ]} " # NB: must already exist in OpenStack
171
- image_name = " ${ source . name } -${ var . os_version } -${ local . timestamp } -${ substr (local. git_commit , 0 , 8 )} " # similar to name from slurm_image_builder
183
+ volume_size = var. volume_size
172
184
}
173
185
174
186
# OFED:
175
187
source "source.openstack.openhpc" {
176
- name = " openhpc-ofed" # this is the only difference from the above
177
- floating_ip_network = " ${ var . floating_ip_network } "
178
- source_image = " ${ var . fatimage_source_image [var . os_version ]} "
179
- source_image_name = " ${ var . fatimage_source_image_name [var . os_version ]} "
180
- image_name = " ${ source . name } -${ var . os_version } -${ local . timestamp } -${ substr (local. git_commit , 0 , 8 )} "
188
+ name = " openhpc-ofed"
189
+ volume_size = var. volume_size_ofed
181
190
}
182
191
183
192
provisioner "ansible" {
0 commit comments