Commit d1445bc6 authored by David Danzilio's avatar David Danzilio

Make PackerBuildName and PackerBuilderType available as Facts during a...

Make PackerBuildName and PackerBuilderType available as Facts during a masterless run similar to the way we do with the Shell provisioner.
parent 8c36684e
......@@ -147,6 +147,8 @@ func (p *Provisioner) Prepare(raws ...interface{}) error {
newFacts[k] = v
}
newFacts["packer_build_name"] = p.config.PackerBuildName
newFacts["packer_builder_type"] = p.config.PackerBuilderType
p.config.Facter = newFacts
// Validation
......
......@@ -106,3 +106,17 @@ can contain various template variables, defined below:
* `ModulePath` - The paths to the module directories.
* `Sudo` - A boolean of whether to `sudo` the command or not, depending on
the value of the `prevent_sudo` configuration.
## Default Facts
In addition to being able to specify custom Facter facts using the `facter`
configuration, the provisioner automatically defines certain commonly useful
facts:
* `packer_build_name` is set to the name of the build that Packer is running.
This is most useful when Packer is making multiple builds and you want to
distinguish them in your Hiera hierarchy.
* `packer_builder_type` is the type of the builder that was used to create the
machine that Puppet is running on. This is useful if you want to run only
certain parts of your Puppet code on systems built with certain builders.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment