Feat!: Convert packer templates to HCL2 format 59/71859/6
authorAnil Belur <abelur@linuxfoundation.org>
Fri, 16 Jun 2023 04:00:04 +0000 (14:00 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Wed, 21 Jun 2023 13:28:22 +0000 (23:28 +1000)
commit6e2fdc9fb5be1d9843d14b6aa6f51356f9655459
tree076328153abba6a1d9886eeb05e18f3165778efb
parentbf978b3973075d1684498db13fc5bfa3d6e0b3d3
Feat!: Convert packer templates to HCL2 format

As of packer version 1.7.0 HCL2 is the preferred way to write Packer
templates. HCL2 preserves existing workflows while leveraging HCL2’s
advanced features like variable interpolation and configuration
composability.

Migrate packer templates from JSON to HCL2 format. JSON format
templates are deprecated and no longer works with packer
version > 1.9.x.

Packer version 1.9.1 will be minimum required version for packer jobs.
This version requires installing the cloud specific plugins through
packer config and needs to be initalized and downloaded with
`packer init` before running `packer build`.

Add support for host key algorithms to work with local ssh proxy
without which packer builds results in "failed to handshake" error.
Workaround is to pass additional params with "extra_arguments".

Support for '.json' templates will be removed from common-packer in
subsequent releases. All projects specific templates not available in this
repository are required to convert existing '.json' to '.pkr.hcl' format.

This change requires updating CI jobs with the additional steps.

Ref:
https://developer.hashicorp.com/packer/docs/templates/hcl_templates
https://github.com/hashicorp/packer-plugin-openstack/blob/main/README.md
https://github.com/hashicorp/packer-plugin-ansible/issues/140

Issue: RELENG-4764
Change-Id: Ie63d9551bd1bab224dc9335d45a21d5ee3e09550
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
25 files changed:
docs/requirements.rst
docs/usage.rst
releasenotes/notes/convert-templates-json-to-hcl-aaf848118544e70f.yaml [new file with mode: 0644]
templates/builder-aws.pkr.hcl [new file with mode: 0644]
templates/builder.pkr.hcl [new file with mode: 0644]
templates/devstack-pre-pip-yoga.pkr.hcl [new file with mode: 0644]
templates/devstack.pkr.hcl [new file with mode: 0644]
templates/docker-aws.pkr.hcl [new file with mode: 0644]
templates/docker.pkr.hcl [new file with mode: 0644]
templates/variables.auto.pkr.hcl [new file with mode: 0644]
templates/windows-builder.pkr.hcl [new file with mode: 0644]
vars/centos-7-arm64.pkrvars.hcl [new file with mode: 0644]
vars/centos-7.pkrvars.hcl [new file with mode: 0644]
vars/centos-8.pkrvars.hcl [new file with mode: 0644]
vars/centos-cs-8.pkrvars.hcl [new file with mode: 0644]
vars/centos-cs-9.pkrvars.hcl [new file with mode: 0644]
vars/cloud-env-aws.pkrvars.hcl [new file with mode: 0644]
vars/cloud-env.pkrvars.hcl [new file with mode: 0644]
vars/ubuntu-16.04-arm64.pkrvars.hcl [new file with mode: 0644]
vars/ubuntu-16.04.pkrvars.hcl [new file with mode: 0644]
vars/ubuntu-18.04-arm64.pkrvars.hcl [new file with mode: 0644]
vars/ubuntu-18.04.pkrvars.hcl [new file with mode: 0644]
vars/ubuntu-20.04-arm64.pkrvars.hcl [new file with mode: 0644]
vars/ubuntu-20.04.pkrvars.hcl [new file with mode: 0644]
vars/windows-server-2016.pkrvars.hcl [new file with mode: 0644]