provisioner/anisble: use randomized staging dir

This commit is contained in:
Matthew Hooker 2017-01-27 16:14:31 -08:00
parent 6d102d5870
commit 45030e1919
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1
1 changed files with 2 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import (
"strings" "strings"
"github.com/mitchellh/packer/common" "github.com/mitchellh/packer/common"
"github.com/mitchellh/packer/common/uuid"
"github.com/mitchellh/packer/helper/config" "github.com/mitchellh/packer/helper/config"
"github.com/mitchellh/packer/packer" "github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/template/interpolate" "github.com/mitchellh/packer/template/interpolate"
@ -85,7 +86,7 @@ func (p *Provisioner) Prepare(raws ...interface{}) error {
} }
if p.config.StagingDir == "" { if p.config.StagingDir == "" {
p.config.StagingDir = DefaultStagingDir p.config.StagingDir = filepath.Join(DefaultStagingDir, uuid.TimeOrderedUUID())
} }
// Validation // Validation