Moving vsphere-tpl to vsphere-template, fixed root folder creation and updated docs

This commit is contained in:
bugbuilder 2017-07-10 20:52:48 -04:00
parent b88fb8bdb2
commit 3cc9f204ac
9 changed files with 20 additions and 15 deletions

View File

@ -54,7 +54,7 @@ import (
vagrantpostprocessor "github.com/hashicorp/packer/post-processor/vagrant"
vagrantcloudpostprocessor "github.com/hashicorp/packer/post-processor/vagrant-cloud"
vspherepostprocessor "github.com/hashicorp/packer/post-processor/vsphere"
vspheretplpostprocessor "github.com/hashicorp/packer/post-processor/vsphere-tpl"
vspheretemplatepostprocessor "github.com/hashicorp/packer/post-processor/vsphere-template"
ansibleprovisioner "github.com/hashicorp/packer/provisioner/ansible"
ansiblelocalprovisioner "github.com/hashicorp/packer/provisioner/ansible-local"
chefclientprovisioner "github.com/hashicorp/packer/provisioner/chef-client"
@ -137,7 +137,7 @@ var PostProcessors = map[string]packer.PostProcessor{
"vagrant": new(vagrantpostprocessor.PostProcessor),
"vagrant-cloud": new(vagrantcloudpostprocessor.PostProcessor),
"vsphere": new(vspherepostprocessor.PostProcessor),
"vsphere-tpl": new(vspheretplpostprocessor.PostProcessor),
"vsphere-template": new(vspheretemplatepostprocessor.PostProcessor),
}
var pluginRegexp = regexp.MustCompile("packer-(builder|post-processor|provisioner)-(.+)")

View File

@ -1,4 +1,4 @@
package vsphere_tpl
package vsphere_template
import (
"context"

View File

@ -1,4 +1,4 @@
package vsphere_tpl
package vsphere_template
import (
"testing"

View File

@ -1,4 +1,4 @@
package vsphere_tpl
package vsphere_template
import (
"context"

View File

@ -1,4 +1,4 @@
package vsphere_tpl
package vsphere_template
import (
"context"
@ -41,6 +41,12 @@ func (s *StepCreateFolder) Run(state multistep.StateBag) multistep.StepAction {
_, folder := filepath.Split(path)
folders = append(folders, folder)
if i := strings.LastIndex(path, "/"); i == 0 {
root, err = f.Folder(ctx, filepath.ToSlash(base))
if err != nil {
state.Put("error", err)
ui.Error(err.Error())
return multistep.ActionHalt
}
break
} else {
path = path[:i]

View File

@ -1,4 +1,4 @@
package vsphere_tpl
package vsphere_template
import (
"context"
@ -60,8 +60,7 @@ func (s *StepFetchVm) Run(state multistep.StateBag) multistep.StepAction {
return multistep.ActionHalt
}
err = task.Wait(ctx)
if err != nil {
if err = task.Wait(ctx); err != nil {
state.Put("error", err)
ui.Error(err.Error())
return multistep.ActionHalt

View File

@ -1,4 +1,4 @@
package vsphere_tpl
package vsphere_template
import (
"context"

View File

@ -1,4 +1,4 @@
package vsphere_tpl
package vsphere_template
import (
"context"

View File

@ -1,6 +1,6 @@
---
description: |
The Packer vSphere Template post-processor takes an artifact from the VMware-iso builder -**only if remote ESXI is chosen**-
The Packer vSphere Template post-processor takes an artifact from the VMware-iso builder -**only if remote ESXI was chosen**-
and allows to mark a VM as a template and leaving it in a path of choice.
layout: docs
page_title: 'vSphere Template - Post-Processors'
@ -9,9 +9,9 @@ sidebar_current: 'docs-post-processors-vSphere-template'
# vSphere Template Post-Processor
Type: `vsphere-tpl`
Type: `vsphere-template`
The Packer vSphere template post-processor takes an artifact from the VMware-iso builder
The Packer vSphere template post-processor takes an artifact from the VMware-iso builder -**only if remote ESXI was chosen**-
allows to mark a VM as a template and leaving it in a path of choice.
## Example
@ -20,7 +20,7 @@ An example is shown below, showing only the post-processor configuration:
``` json
{
"type": "vsphere-tpl",
"type": "vsphere-template",
"host": "vcenter.local",
"username": "root",
"password": "secret",