Commit Graph

8 Commits

Author SHA1 Message Date
Adrien Delorme 77a29fc2f8
Allow to have `dynamic` blocks in a `build` block + tests (#10825)
This :
* allows to have a `build.dynamic` block
* add tests
* makes sure to show a correct message when a source was not found
  * display only name of source (instead of a weird map printout) 
  * use a "Did you mean %q" feature where possible 


Because dynamic blocks need all variables to be evaluated and available, I moved parsing of everything that is not a variable to "after" variables are extrapolated. Meaning that dynamic block get expanded in the `init` phase and then only we start interpreting HCL2 content.

After #10819 fix #10657
2021-03-30 15:53:04 +02:00
Adrien Delorme 0e3fcb589b
Implicit required_plugin blocks (#10732)
* used components that don't have a required_plugin block will make Packer 'implicitly' require those. These components are manually selected and commented for now.
* add tests
 * docs
2021-03-24 11:31:39 +01:00
Adrien Delorme 8208f425c8 addrs: remove Plugin.ForDisplay func, the String one does the job
to make things less confusing
2021-02-15 15:32:42 +01:00
Sylvia Moss 774c5903f6
Add error-cleanup-provisioner to HCL2 (#10604) 2021-02-11 10:23:15 +01:00
Adrien Delorme ffbb110167
Test running plugins with fake and fresh plugins (#10595)
* show error as to why plugin discovery failed
* allow to run more manual tests after a plugin installation
* test that a freshly installed external plugin can run
2021-02-09 17:07:59 +01:00
Sylvia Moss 3ddb17ad86
Don't allow data sources to be used inside data sources (#10559) 2021-02-04 11:25:44 +01:00
Wilken Rivera 8ccd164f25
Update diagnostic detail to display list of PostProcessors (#10564) 2021-02-04 10:56:59 +01:00
Adrien Delorme ed091163be
HCL2 Parse packer.required_plugins block + packer init (#10304)
This adds the new `required_plugins` block to be nested under the packer block.

Example:
```hcl
packer {
  required_plugins {
    aws = {
      version = ">= 2.7.0"
      source = "azr/aws"
    }
    azure = ">= 2.7.0"
  }
}
```

For example on darwin_amd64 Packer will install those under :
* "${PACKER_HOME_DIR}/plugin/github.com/azr/amazon/packer-plugin-amazon_2.7.0_x5.0_darwin_amd64"
* "${PACKER_HOME_DIR}/plugin/github.com/hashicorp/azure/packer-plugin-azure_2.7.0_x5.0_darwin_amd64_x5"

+ docs
+ tests
2021-02-02 18:05:04 +01:00