The source names inside only and except of provision block should be without "source." prefix. The previous commit introduced "sources." prefix which broke the AlmaLinux OS 9.4 Vagrant boxes with ignoring entire provisioners and creating boxes without any configuration.
Add "ANSIBLE_HOST_KEY_CHECKING=False" for AlmaLinux OS 9 Vagrant box for Hyper-V provider.
Add "hyperv-iso.almalinux-9" to Vagrant post-processor.
Formatting:
These recent bugs also made me review the latest documentation of HCL2 for Packer.
These best practices applied to avoid any kind of this issue and have a consistency on all Packer templates.
Use "source." prefix on all build blocks.
Use trailing commas on multi-line HCL2 list types.
Use native syntax for multi-line HCL2 map typse with replacing colon with equal and remove comma separator.
Don't use any prefix for provision and post-processor blocks.
We started to write these Packer templates when the JSON to HCL2 transition was new. As HCL2 support on Packer evolves it got new features and core syntax is stabilized now.
These changes optimize all the templates regardless of when they are written.
Fixes:
The source names inside only and except of provision block should be without "source." prefix. The previous commit introduced "sources." prefix which broke the AlmaLinux OS 9.4 Vagrant boxes with ignoring entire provisioners and creating boxes without any configuration.
Add "ANSIBLE_HOST_KEY_CHECKING=False" for AlmaLinux OS 9 Vagrant box for Hyper-V provider.
Add "hyperv-iso.almalinux-9" to Vagrant post-processor.
Formatting:
These recent bugs also made me review the latest documentation of HCL2 for Packer.
These best practices applied to avoid any kind of this issue and have a consistency on all Packer templates.
We started to write these Packer templates when the JSON to HCL2 transition was new. As HCL2 support on Packer evolves it got new features and core syntax is stabilized now.
These changes optimize all the templates regardless of when they are written.