diff --git a/CHANGELOG.md b/CHANGELOG.md index b972438d1..f271cc6c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,8 @@ BUG FIXES: * builder/virtualbox,vmware/qemu: Support for additional scancodes for `boot_command` such as ``, ``, ``, etc. [GH-808] * communicator/ssh: Send TCP keep-alives on connections. [GH-872] +* post-processor/vagrant: AWS/DigitalOcean keep input artifacts by + default. [GH-55] * provisioners/ansible-local: Properly upload custom playbooks. [GH-829] ## 0.5.1 (01/02/2014) diff --git a/post-processor/vagrant/aws.go b/post-processor/vagrant/aws.go index cddadd7e6..da9088ffc 100644 --- a/post-processor/vagrant/aws.go +++ b/post-processor/vagrant/aws.go @@ -11,6 +11,10 @@ import ( type AWSProvider struct{} +func (p *AWSProvider) KeepInputArtifact() bool { + return true +} + func (p *AWSProvider) Process(ui packer.Ui, artifact packer.Artifact, dir string) (vagrantfile string, metadata map[string]interface{}, err error) { // Create the metadata metadata = map[string]interface{}{"provider": "aws"} diff --git a/post-processor/vagrant/digitalocean.go b/post-processor/vagrant/digitalocean.go index aa7a757ff..f14284e37 100644 --- a/post-processor/vagrant/digitalocean.go +++ b/post-processor/vagrant/digitalocean.go @@ -15,6 +15,10 @@ type digitalOceanVagrantfileTemplate struct { type DigitalOceanProvider struct{} +func (p *DigitalOceanProvider) KeepInputArtifact() bool { + return true +} + func (p *DigitalOceanProvider) Process(ui packer.Ui, artifact packer.Artifact, dir string) (vagrantfile string, metadata map[string]interface{}, err error) { // Create the metadata metadata = map[string]interface{}{"provider": "digital_ocean"} diff --git a/post-processor/vagrant/post-processor.go b/post-processor/vagrant/post-processor.go index eae580151..e0076febf 100644 --- a/post-processor/vagrant/post-processor.go +++ b/post-processor/vagrant/post-processor.go @@ -152,7 +152,7 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac return nil, false, err } - return NewArtifact(name, outputPath), false, nil + return NewArtifact(name, outputPath), provider.KeepInputArtifact(), nil } func (p *PostProcessor) configureSingle(config *Config, raws ...interface{}) error { diff --git a/post-processor/vagrant/provider.go b/post-processor/vagrant/provider.go index 00201cb9c..cda29fcb7 100644 --- a/post-processor/vagrant/provider.go +++ b/post-processor/vagrant/provider.go @@ -7,6 +7,10 @@ import ( // Provider is the interface that each provider must implement in order // to package the artifacts into a Vagrant-compatible box. type Provider interface { + // KeepInputArtifact should return true/false whether this provider + // requires the input artifact to be kept by default. + KeepInputArtifact() bool + // Process is called to process an artifact into a Vagrant box. The // artifact is given as well as the temporary directory path to // put things. diff --git a/post-processor/vagrant/virtualbox.go b/post-processor/vagrant/virtualbox.go index eeaf401c6..ade31b2fb 100644 --- a/post-processor/vagrant/virtualbox.go +++ b/post-processor/vagrant/virtualbox.go @@ -15,6 +15,10 @@ import ( type VBoxProvider struct{} +func (p *VBoxProvider) KeepInputArtifact() bool { + return false +} + func (p *VBoxProvider) Process(ui packer.Ui, artifact packer.Artifact, dir string) (vagrantfile string, metadata map[string]interface{}, err error) { // Create the metadata metadata = map[string]interface{}{"provider": "virtualbox"} diff --git a/post-processor/vagrant/vmware.go b/post-processor/vagrant/vmware.go index d3ff50d24..75427397e 100644 --- a/post-processor/vagrant/vmware.go +++ b/post-processor/vagrant/vmware.go @@ -8,6 +8,10 @@ import ( type VMwareProvider struct{} +func (p *VMwareProvider) KeepInputArtifact() bool { + return false +} + func (p *VMwareProvider) Process(ui packer.Ui, artifact packer.Artifact, dir string) (vagrantfile string, metadata map[string]interface{}, err error) { // Create the metadata metadata = map[string]interface{}{"provider": "vmware_desktop"}