post-processor/vagrant: AWS/DO keep input artifacts [GH-55]

pull/919/head
Mitchell Hashimoto 12 years ago
parent 4d623de9a2
commit 20d7f74fc4

@ -29,6 +29,8 @@ BUG FIXES:
* builder/virtualbox,vmware/qemu: Support for additional scancodes for
`boot_command` such as `<up>`, `<left>`, `<insert>`, 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)

@ -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"}

@ -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"}

@ -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 {

@ -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.

@ -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"}

@ -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"}

Loading…
Cancel
Save