mirror of https://github.com/hashicorp/packer
This change allows users of HCL2 templates to run packer init against a HCL file that has no required_plugin block and have it automatically install the latest version, when PACKER_LEGACY_MODE=off. If a required_plugins block is in the config that will take precedence over the implicitly required logic. ``` // Running init against template with required plugin block for github.com/hashicorp/amazon v1.0.1 ~> PACKER_LEGACY_MODE=on go run . init ../packer-templates/amazon-ebs/amazon-ebs_ubuntu_shell-local.pkr.hcl Installed plugin github.com/hashicorp/amazon v1.0.1 in "~/.packer.d/plugins/github.com/hashicorp/amazon/packer-plugin-amazon_v1.0.1_x5.0_darwin_amd64" // Running init against template with no required plugin block after a successful init for github.com/hashicorp/amazon v1.0.1 ~> PACKER_LEGACY_MODE=on go run . init ../packer-templates/amazon-ebs/amazon-ebs_ubuntu_shell-local.pkr.hcl // Running init against template with no required plugin block and no previously installed plugins on the system ~> rm ~/.packer.d/plugins/github.com/hashicorp/amazon/packer-plugin-amazon_v1.0.1_x5.0_darwin_amd64 ~> PACKER_LEGACY_MODE=off go run . init ../packer-templates/amazon-ebs/amazon-ebs_ubuntu_shell-local.pkr.hcl Installed implicitly required plugin github.com/hashicorp/amazon v1.0.8 in "~/.packer.d/plugins/github.com/hashicorp/amazon/packer-plugin-amazon_v1.0.8_x5.0_darwin_amd64" Warning, at least one component used in your config file(s) has moved out of Packer into the "github.com/hashicorp/amazon" plugin and is now being implicitly required. For more details on implicitly required plugins see https://packer.io/docs/commands/init#implicit-required-plugin To avoid any backward incompatible changes with your config file you may want to lock the plugin version by pasting the following to your config: packer { required_plugins { amazon = { source = "github.com/hashicorp/amazon" version = "~> v1.0.8" } } } ```wilken/implicitly-required-plugins-legacy-mode
parent
323ecdd31b
commit
e7d249fd5f
Loading…
Reference in new issue