From 4d439da7fd505d20c1a212ab49f385aa7878b953 Mon Sep 17 00:00:00 2001 From: Anil Belur Date: Fri, 7 Nov 2025 09:56:02 +1000 Subject: [PATCH] fix: Add Packer 1.11.x plugin compatibility - Added required_plugins blocks to all template files - Declared openstack, docker, amazon, and ansible plugins - Added .packer.d/ to .gitignore Fixes compatibility with Packer 1.11.x while maintaining backward compatibility with 1.9.x and 1.10.x. Templates updated: - builder.pkr.hcl - docker.pkr.hcl - devstack.pkr.hcl - devstack-pre-pip-yoga.pkr.hcl - windows-builder.pkr.hcl - builder-aws.pkr.hcl - docker-aws.pkr.hcl Issue: RELENG-5871 Change-Id: Id7c980a76f80bfff011fea5a53c624d83cbbab2d Signed-off-by: Anil Belur --- .gitignore | 1 + ...1.11-plugin-compatibility-b48eee66dc774e5c.yaml | 31 ++++++++++++++++++++++ templates/builder-aws.pkr.hcl | 4 +++ templates/builder.pkr.hcl | 8 ++++++ templates/devstack-pre-pip-yoga.pkr.hcl | 8 ++++++ templates/devstack.pkr.hcl | 8 ++++++ templates/docker-aws.pkr.hcl | 4 +++ templates/docker.pkr.hcl | 8 ++++++ templates/windows-builder.pkr.hcl | 4 +++ 9 files changed, 76 insertions(+) create mode 100644 releasenotes/notes/packer-1.11-plugin-compatibility-b48eee66dc774e5c.yaml diff --git a/.gitignore b/.gitignore index 933b98b..ce4b38a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ cloud-env.json *.pyc *.retry node_modules/ +.packer.d/ diff --git a/releasenotes/notes/packer-1.11-plugin-compatibility-b48eee66dc774e5c.yaml b/releasenotes/notes/packer-1.11-plugin-compatibility-b48eee66dc774e5c.yaml new file mode 100644 index 0000000..7f2e686 --- /dev/null +++ b/releasenotes/notes/packer-1.11-plugin-compatibility-b48eee66dc774e5c.yaml @@ -0,0 +1,31 @@ +--- +fixes: + - | + Fixed compatibility with Packer 1.11.x by adding explicit plugin + declarations to all template files. Packer 1.11.x introduced stricter + plugin validation requiring all plugins to be declared in + ``required_plugins`` blocks. + + Updated templates with required_plugins blocks: + + - builder.pkr.hcl (openstack, docker, ansible) + - docker.pkr.hcl (openstack, docker, ansible) + - devstack.pkr.hcl (openstack, docker, ansible) + - devstack-pre-pip-yoga.pkr.hcl (openstack, docker, ansible) + - windows-builder.pkr.hcl (openstack, ansible) + - builder-aws.pkr.hcl (amazon, ansible) + - docker-aws.pkr.hcl (amazon, ansible) + + This fix maintains backward compatibility with Packer 1.9.x and 1.10.x + while ensuring builds work correctly with Packer 1.11.x and future + versions. The GitHub Actions workflow already includes the necessary + ``packer init`` command to download plugins. + + Added .packer.d/ directory to .gitignore to exclude plugin cache. +upgrade: + - | + No action required for existing deployments. All changes are backward + compatible with Packer 1.9.x and 1.10.x. If upgrading to or using + Packer 1.11.x, ensure ``packer init`` is run before ``packer build`` + or ``packer validate`` to download the required plugins (this is + already handled in the CI/CD workflow). diff --git a/templates/builder-aws.pkr.hcl b/templates/builder-aws.pkr.hcl index 1f903fe..9138641 100644 --- a/templates/builder-aws.pkr.hcl +++ b/templates/builder-aws.pkr.hcl @@ -4,6 +4,10 @@ packer { version = ">= 1.2.6" source = "github.com/hashicorp/amazon" } + ansible = { + version = ">= 1.0.0" + source = "github.com/hashicorp/ansible" + } } } diff --git a/templates/builder.pkr.hcl b/templates/builder.pkr.hcl index 8dd4b46..f805d1b 100644 --- a/templates/builder.pkr.hcl +++ b/templates/builder.pkr.hcl @@ -4,6 +4,14 @@ packer { version = ">= 1.0.0" source = "github.com/hashicorp/openstack" } + docker = { + version = ">= 1.0.0" + source = "github.com/hashicorp/docker" + } + ansible = { + version = ">= 1.0.0" + source = "github.com/hashicorp/ansible" + } } } diff --git a/templates/devstack-pre-pip-yoga.pkr.hcl b/templates/devstack-pre-pip-yoga.pkr.hcl index 40c3e9d..abcbbc1 100644 --- a/templates/devstack-pre-pip-yoga.pkr.hcl +++ b/templates/devstack-pre-pip-yoga.pkr.hcl @@ -4,6 +4,14 @@ packer { version = ">= 1.0.0" source = "github.com/hashicorp/openstack" } + docker = { + version = ">= 1.0.0" + source = "github.com/hashicorp/docker" + } + ansible = { + version = ">= 1.0.0" + source = "github.com/hashicorp/ansible" + } } } diff --git a/templates/devstack.pkr.hcl b/templates/devstack.pkr.hcl index 48feb6a..0fd8c88 100644 --- a/templates/devstack.pkr.hcl +++ b/templates/devstack.pkr.hcl @@ -4,6 +4,14 @@ packer { version = ">= 1.0.0" source = "github.com/hashicorp/openstack" } + docker = { + version = ">= 1.0.0" + source = "github.com/hashicorp/docker" + } + ansible = { + version = ">= 1.0.0" + source = "github.com/hashicorp/ansible" + } } } diff --git a/templates/docker-aws.pkr.hcl b/templates/docker-aws.pkr.hcl index 4bf2d98..d2e91d6 100644 --- a/templates/docker-aws.pkr.hcl +++ b/templates/docker-aws.pkr.hcl @@ -4,6 +4,10 @@ packer { version = ">= 1.2.6" source = "github.com/hashicorp/amazon" } + ansible = { + version = ">= 1.0.0" + source = "github.com/hashicorp/ansible" + } } } diff --git a/templates/docker.pkr.hcl b/templates/docker.pkr.hcl index d157dbf..bd3e8fa 100644 --- a/templates/docker.pkr.hcl +++ b/templates/docker.pkr.hcl @@ -4,6 +4,14 @@ packer { version = ">= 1.0.0" source = "github.com/hashicorp/openstack" } + docker = { + version = ">= 1.0.0" + source = "github.com/hashicorp/docker" + } + ansible = { + version = ">= 1.0.0" + source = "github.com/hashicorp/ansible" + } } } diff --git a/templates/windows-builder.pkr.hcl b/templates/windows-builder.pkr.hcl index f744cc2..35d5a79 100644 --- a/templates/windows-builder.pkr.hcl +++ b/templates/windows-builder.pkr.hcl @@ -4,6 +4,10 @@ packer { version = ">= 1.0.0" source = "github.com/hashicorp/openstack" } + ansible = { + version = ">= 1.0.0" + source = "github.com/hashicorp/ansible" + } } } -- 2.16.6