From 0649c3f7dca9aabc2b8603cfa723a41a78fe9d30 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Fri, 20 Dec 2019 12:05:01 -0800 Subject: [PATCH] update plugin configspec docs --- website/source/docs/extending/custom-builders.html.md | 6 ++++++ .../docs/extending/custom-post-processors.html.md | 9 ++++++++- .../source/docs/extending/custom-provisioners.html.md | 11 +++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/website/source/docs/extending/custom-builders.html.md b/website/source/docs/extending/custom-builders.html.md index 1cd2b6094..d23eb1bfc 100644 --- a/website/source/docs/extending/custom-builders.html.md +++ b/website/source/docs/extending/custom-builders.html.md @@ -36,6 +36,12 @@ type Builder interface { Run(context.Context, ui Ui, hook Hook) (Artifact, error) } ``` +### The "ConfigSpec" Method + +This method returns a hcldec.ObjectSpec, which is a spec necessary for using +HCL2 templates with Packer. For information on how to use and implement this +function, check our +[object spec docs](https://www.packer.io/guides/hcl/component-object-spec) ### The "Prepare" Method diff --git a/website/source/docs/extending/custom-post-processors.html.md b/website/source/docs/extending/custom-post-processors.html.md index 7f717346a..4a66f5469 100644 --- a/website/source/docs/extending/custom-post-processors.html.md +++ b/website/source/docs/extending/custom-post-processors.html.md @@ -42,6 +42,13 @@ type PostProcessor interface { } ``` +### The "ConfigSpec" Method + +This method returns a hcldec.ObjectSpec, which is a spec necessary for using +HCL2 templates with Packer. For information on how to use and implement this +function, check our +[object spec docs](https://www.packer.io/guides/hcl/component-object-spec) + ### The "Configure" Method The `Configure` method for each post-processor is called early in the build @@ -92,6 +99,6 @@ return value is explained below: keep the artifact around. - `bool` - If forceOverride is true, then any user input for keep_input_artifact is ignored and the artifact is either kept or discarded - according to the value set in `keep`. + according to the value set in `keep`. - `error` - Non-nil if there was an error in any way. If this is the case, the other two return values are ignored. diff --git a/website/source/docs/extending/custom-provisioners.html.md b/website/source/docs/extending/custom-provisioners.html.md index 0d6d7f15b..03b73efbf 100644 --- a/website/source/docs/extending/custom-provisioners.html.md +++ b/website/source/docs/extending/custom-provisioners.html.md @@ -67,6 +67,13 @@ validate the configuration. The `Prepare` method is called very early in the build process so that errors may be displayed to the user before anything actually happens. +### The "ConfigSpec" Method + +This method returns a hcldec.ObjectSpec, which is a spec necessary for using +HCL2 templates with Packer. For information on how to use and implement this +function, check our +[object spec docs](https://www.packer.io/guides/hcl/component-object-spec) + ### The "Provision" Method The `Provision` method is called when a machine is running and ready to be @@ -79,6 +86,10 @@ connected at this point. The provision method should not return until provisioning is complete. +The map[string]interface{} provides users with build-specific information, +like host and IP, provided by the `build` template engine. Provisioners may use +this information however they please, or not use it. + ## Using the Communicator The `packer.Communicator` parameter and interface is used to communicate with