fix: Add Packer 1.11.x plugin compatibility 65/73865/1
authorAnil Belur <abelur@linuxfoundation.org>
Thu, 6 Nov 2025 23:56:02 +0000 (09:56 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Fri, 7 Nov 2025 00:09:19 +0000 (10:09 +1000)
- 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 <abelur@linuxfoundation.org>
.gitignore
releasenotes/notes/packer-1.11-plugin-compatibility-b48eee66dc774e5c.yaml [new file with mode: 0644]
templates/builder-aws.pkr.hcl
templates/builder.pkr.hcl
templates/devstack-pre-pip-yoga.pkr.hcl
templates/devstack.pkr.hcl
templates/docker-aws.pkr.hcl
templates/docker.pkr.hcl
templates/windows-builder.pkr.hcl

index 933b98b..ce4b38a 100644 (file)
@@ -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 (file)
index 0000000..7f2e686
--- /dev/null
@@ -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).
index 1f903fe..9138641 100644 (file)
@@ -4,6 +4,10 @@ packer {
       version = ">= 1.2.6"
       source  = "github.com/hashicorp/amazon"
     }
+    ansible = {
+      version = ">= 1.0.0"
+      source  = "github.com/hashicorp/ansible"
+    }
   }
 }
 
index 8dd4b46..f805d1b 100644 (file)
@@ -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"
+    }
   }
 }
 
index 40c3e9d..abcbbc1 100644 (file)
@@ -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"
+    }
   }
 }
 
index 48feb6a..0fd8c88 100644 (file)
@@ -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"
+    }
   }
 }
 
index 4bf2d98..d2e91d6 100644 (file)
@@ -4,6 +4,10 @@ packer {
       version = ">= 1.2.6"
       source  = "github.com/hashicorp/amazon"
     }
+    ansible = {
+      version = ">= 1.0.0"
+      source  = "github.com/hashicorp/ansible"
+    }
   }
 }
 
index d157dbf..bd3e8fa 100644 (file)
@@ -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"
+    }
   }
 }
 
index f744cc2..35d5a79 100644 (file)
@@ -4,6 +4,10 @@ packer {
       version = ">= 1.0.0"
       source  = "github.com/hashicorp/openstack"
     }
+    ansible = {
+      version = ">= 1.0.0"
+      source  = "github.com/hashicorp/ansible"
+    }
   }
 }