shell-local: expose PACKER_HTTP_ADDR env var
This commit is contained in:
parent
b28098e0f7
commit
edcc0b3853
|
@ -9,6 +9,7 @@ import (
|
|||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/packer/common"
|
||||
commonhelper "github.com/hashicorp/packer/helper/common"
|
||||
"github.com/hashicorp/packer/packer"
|
||||
"github.com/hashicorp/packer/template/interpolate"
|
||||
|
@ -165,6 +166,12 @@ func createFlattenedEnvVars(config *Config) (string, error) {
|
|||
envVars["PACKER_BUILD_NAME"] = fmt.Sprintf("%s", config.PackerBuildName)
|
||||
envVars["PACKER_BUILDER_TYPE"] = fmt.Sprintf("%s", config.PackerBuilderType)
|
||||
|
||||
// expose PACKER_HTTP_ADDR
|
||||
httpAddr := common.GetHTTPAddr()
|
||||
if httpAddr != "" {
|
||||
envVars["PACKER_HTTP_ADDR"] = fmt.Sprintf("%s", httpAddr)
|
||||
}
|
||||
|
||||
// interpolate environment variables
|
||||
config.Ctx.Data = &EnvVarsTemplate{
|
||||
WinRMPassword: getWinRMPassword(config.PackerBuildName),
|
||||
|
|
Loading…
Reference in New Issue