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
6cb51f21
Commit
6cb51f21
authored
Jun 22, 2015
by
Salvador Girones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make ResourcePool optional
parent
f41429b6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
post-processor/vsphere/post-processor.go
post-processor/vsphere/post-processor.go
+12
-8
website/source/docs/post-processors/vsphere.html.markdown
website/source/docs/post-processors/vsphere.html.markdown
+1
-1
No files found.
post-processor/vsphere/post-processor.go
View file @
6cb51f21
...
...
@@ -72,7 +72,6 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
"diskmode"
:
&
p
.
config
.
DiskMode
,
"host"
:
&
p
.
config
.
Host
,
"password"
:
&
p
.
config
.
Password
,
"resource_pool"
:
&
p
.
config
.
ResourcePool
,
"username"
:
&
p
.
config
.
Username
,
"vm_name"
:
&
p
.
config
.
VMName
,
}
...
...
@@ -107,6 +106,17 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac
return
nil
,
false
,
fmt
.
Errorf
(
"VMX file not found"
)
}
ovftool_uri
:=
fmt
.
Sprintf
(
"vi://%s:%s@%s/%s/host/%s"
,
url
.
QueryEscape
(
p
.
config
.
Username
),
url
.
QueryEscape
(
p
.
config
.
Password
),
p
.
config
.
Host
,
p
.
config
.
Datacenter
,
p
.
config
.
Cluster
)
if
p
.
config
.
ResourcePool
!=
""
{
ovftool_uri
+=
"/Resources/"
+
p
.
config
.
ResourcePool
}
args
:=
[]
string
{
fmt
.
Sprintf
(
"--noSSLVerify=%t"
,
p
.
config
.
Insecure
),
"--acceptAllEulas"
,
...
...
@@ -116,13 +126,7 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac
fmt
.
Sprintf
(
"--network=%s"
,
p
.
config
.
VMNetwork
),
fmt
.
Sprintf
(
"--vmFolder=%s"
,
p
.
config
.
VMFolder
),
fmt
.
Sprintf
(
"%s"
,
vmx
),
fmt
.
Sprintf
(
"vi://%s:%s@%s/%s/host/%s/Resources/%s/"
,
url
.
QueryEscape
(
p
.
config
.
Username
),
url
.
QueryEscape
(
p
.
config
.
Password
),
p
.
config
.
Host
,
p
.
config
.
Datacenter
,
p
.
config
.
Cluster
,
p
.
config
.
ResourcePool
),
fmt
.
Sprintf
(
"%s"
,
ovftool_uri
),
}
ui
.
Message
(
fmt
.
Sprintf
(
"Uploading %s to vSphere"
,
vmx
))
...
...
website/source/docs/post-processors/vsphere.html.markdown
View file @
6cb51f21
...
...
@@ -35,7 +35,7 @@ Required:
endpoint.
*
`resource_pool`
(string) - The resource pool to upload the VM to.
This is _not required_
if
`datastore`
is specified
.
This is _not required_.
*
`username`
(string) - The username to use to authenticate to the vSphere
endpoint.
...
...
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