hi… assume i have 2 sources, one for VHD for regular azure image , and another vsphere.
both of them are using the same scripts for provisioning
is it possible to use the same build only append to it source modification for azure (that would make it for azure requirements like fixed size gen 1 etc…) , as well so eventually i’ll be able to specify via cli alone to generate either a vsphere vm, and a regular VHD , or a regular VHD that is compatible for azure like so:
build {
sources = [
// "source.file.dummy_for_debug_postProc",
"source.vsphere-iso.engine-vsphere"
]
source "source.hyperv-iso.engine-hv" { #required for azure image
name ="azure-image"
generation = 1
disk_block_size = "1"
disk_size = "70000"
use_fixed_vhd_format=true
differencing_disk = false
skip_compaction = true
}
name="common-build"
...
common proviosniers for all machines
...
provisioner "shell" {
execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
only = ["hyperv-iso.azure-image"]
scripts = [
"${local.workdir}/provisioners/azure.sh"
]
skip_clean = var.skip_clean
}