Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
fce2fc52
Commit
fce2fc52
authored
Apr 30, 2014
by
Michael Kuzmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optional parameters in vSphere post-processor.
datastore, vm_folder, and vm_network options can be omitted.
parent
bb8d0a5e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
10 deletions
+13
-10
post-processor/vsphere/post-processor.go
post-processor/vsphere/post-processor.go
+6
-3
website/source/docs/post-processors/vsphere.html.markdown
website/source/docs/post-processors/vsphere.html.markdown
+7
-7
No files found.
post-processor/vsphere/post-processor.go
View file @
fce2fc52
...
@@ -64,14 +64,11 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
...
@@ -64,14 +64,11 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
templates
:=
map
[
string
]
*
string
{
templates
:=
map
[
string
]
*
string
{
"cluster"
:
&
p
.
config
.
Cluster
,
"cluster"
:
&
p
.
config
.
Cluster
,
"datacenter"
:
&
p
.
config
.
Datacenter
,
"datacenter"
:
&
p
.
config
.
Datacenter
,
"datastore"
:
&
p
.
config
.
Datastore
,
"diskmode"
:
&
p
.
config
.
DiskMode
,
"diskmode"
:
&
p
.
config
.
DiskMode
,
"host"
:
&
p
.
config
.
Host
,
"host"
:
&
p
.
config
.
Host
,
"vm_network"
:
&
p
.
config
.
VMNetwork
,
"password"
:
&
p
.
config
.
Password
,
"password"
:
&
p
.
config
.
Password
,
"resource_pool"
:
&
p
.
config
.
ResourcePool
,
"resource_pool"
:
&
p
.
config
.
ResourcePool
,
"username"
:
&
p
.
config
.
Username
,
"username"
:
&
p
.
config
.
Username
,
"vm_folder"
:
&
p
.
config
.
VMFolder
,
"vm_name"
:
&
p
.
config
.
VMName
,
"vm_name"
:
&
p
.
config
.
VMName
,
}
}
...
@@ -80,7 +77,13 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
...
@@ -80,7 +77,13 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
errs
=
packer
.
MultiErrorAppend
(
errs
=
packer
.
MultiErrorAppend
(
errs
,
fmt
.
Errorf
(
"%s must be set"
,
key
))
errs
,
fmt
.
Errorf
(
"%s must be set"
,
key
))
}
}
}
templates
[
"datastore"
]
=
&
p
.
config
.
Datastore
templates
[
"vm_network"
]
=
&
p
.
config
.
VMNetwork
templates
[
"vm_folder"
]
=
&
p
.
config
.
VMFolder
for
key
,
ptr
:=
range
templates
{
*
ptr
,
err
=
p
.
config
.
tpl
.
Process
(
*
ptr
,
nil
)
*
ptr
,
err
=
p
.
config
.
tpl
.
Process
(
*
ptr
,
nil
)
if
err
!=
nil
{
if
err
!=
nil
{
errs
=
packer
.
MultiErrorAppend
(
errs
=
packer
.
MultiErrorAppend
(
...
...
website/source/docs/post-processors/vsphere.html.markdown
View file @
fce2fc52
...
@@ -23,8 +23,6 @@ Required:
...
@@ -23,8 +23,6 @@ Required:
*
`datacenter`
(string) - The name of the datacenter within vSphere to
*
`datacenter`
(string) - The name of the datacenter within vSphere to
add the VM to.
add the VM to.
*
`datastore`
(string) - The name of the datastore to store this VM.
*
`host`
(string) - The vSphere host that will be contacted to perform
*
`host`
(string) - The vSphere host that will be contacted to perform
the VM upload.
the VM upload.
...
@@ -36,17 +34,19 @@ Required:
...
@@ -36,17 +34,19 @@ Required:
*
`username`
(string) - The username to use to authenticate to the vSphere
*
`username`
(string) - The username to use to authenticate to the vSphere
endpoint.
endpoint.
*
`vm_folder`
(string) - The folder within the datastore to store the VM.
*
`vm_name`
(string) - The name of the VM once it is uploaded.
*
`vm_name`
(string) - The name of the VM once it is uploaded.
*
`vm_network`
(string) - The name of the VM network this VM will be
added to.
Optional:
Optional:
*
`datastore`
(string) - The name of the datastore to store this VM.
*
`disk_mode`
(string) - Target disk format. See
`ovftool`
manual for
*
`disk_mode`
(string) - Target disk format. See
`ovftool`
manual for
available options. By default, "thick" will be used.
available options. By default, "thick" will be used.
*
`insecure`
(bool) - Whether or not the connection to vSphere can be done
*
`insecure`
(bool) - Whether or not the connection to vSphere can be done
over an insecure connection. By default this is false.
over an insecure connection. By default this is false.
*
`vm_folder`
(string) - The folder within the datastore to store the VM.
*
`vm_network`
(string) - The name of the VM network this VM will be
added to.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment