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
bdfac494
Commit
bdfac494
authored
May 09, 2014
by
Ross Smith II
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/vmware: added vmx_data_post option
parent
c1cfd1da
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
2 deletions
+38
-2
builder/vmware/common/vmx_config.go
builder/vmware/common/vmx_config.go
+24
-2
builder/vmware/iso/builder.go
builder/vmware/iso/builder.go
+3
-0
builder/vmware/vmx/builder.go
builder/vmware/vmx/builder.go
+3
-0
website/source/docs/builders/vmware-iso.html.markdown
website/source/docs/builders/vmware-iso.html.markdown
+4
-0
website/source/docs/builders/vmware-vmx.html.markdown
website/source/docs/builders/vmware-vmx.html.markdown
+4
-0
No files found.
builder/vmware/common/vmx_config.go
View file @
bdfac494
...
...
@@ -8,6 +8,7 @@ import (
type
VMXConfig
struct
{
VMXData
map
[
string
]
string
`mapstructure:"vmx_data"`
VMXDataPost
map
[
string
]
string
`mapstructure:"vmx_data_post"`
}
func
(
c
*
VMXConfig
)
Prepare
(
t
*
packer
.
ConfigTemplate
)
[]
error
{
...
...
@@ -18,14 +19,14 @@ func (c *VMXConfig) Prepare(t *packer.ConfigTemplate) []error {
k
,
err
=
t
.
Process
(
k
,
nil
)
if
err
!=
nil
{
errs
=
append
(
errs
,
fmt
.
Errorf
(
"Error processing
VMX
data key %s: %s"
,
k
,
err
))
fmt
.
Errorf
(
"Error processing
vmx_
data key %s: %s"
,
k
,
err
))
continue
}
v
,
err
=
t
.
Process
(
v
,
nil
)
if
err
!=
nil
{
errs
=
append
(
errs
,
fmt
.
Errorf
(
"Error processing
VMX
data value '%s': %s"
,
v
,
err
))
fmt
.
Errorf
(
"Error processing
vmx_
data value '%s': %s"
,
v
,
err
))
continue
}
...
...
@@ -33,5 +34,26 @@ func (c *VMXConfig) Prepare(t *packer.ConfigTemplate) []error {
}
c
.
VMXData
=
newVMXData
newVMXDataPost
:=
make
(
map
[
string
]
string
)
for
k
,
v
:=
range
c
.
VMXDataPost
{
var
err
error
k
,
err
=
t
.
Process
(
k
,
nil
)
if
err
!=
nil
{
errs
=
append
(
errs
,
fmt
.
Errorf
(
"Error processing vmx_post_data key %s: %s"
,
k
,
err
))
continue
}
v
,
err
=
t
.
Process
(
v
,
nil
)
if
err
!=
nil
{
errs
=
append
(
errs
,
fmt
.
Errorf
(
"Error processing vmx_post_data value '%s': %s"
,
v
,
err
))
continue
}
newVMXData
[
k
]
=
v
}
c
.
VMXDataPost
=
newVMXDataPost
return
errs
}
builder/vmware/iso/builder.go
View file @
bdfac494
...
...
@@ -371,6 +371,9 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
},
&
vmwcommon
.
StepCleanFiles
{},
&
vmwcommon
.
StepCleanVMX
{},
&
vmwcommon
.
StepConfigureVMX
{
CustomData
:
b
.
config
.
VMXDataPost
,
},
&
vmwcommon
.
StepCompactDisk
{
Skip
:
b
.
config
.
SkipCompaction
,
},
...
...
builder/vmware/vmx/builder.go
View file @
bdfac494
...
...
@@ -85,6 +85,9 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
},
&
vmwcommon
.
StepCleanFiles
{},
&
vmwcommon
.
StepCleanVMX
{},
&
vmwcommon
.
StepConfigureVMX
{
CustomData
:
b
.
config
.
VMXDataPost
,
},
&
vmwcommon
.
StepCompactDisk
{
Skip
:
b
.
config
.
SkipCompaction
,
},
...
...
website/source/docs/builders/vmware-iso.html.markdown
View file @
bdfac494
...
...
@@ -227,6 +227,10 @@ each category, the available options are alphabetized and described.
to enter into the virtual machine VMX file. This is for advanced users
who want to set properties such as memory, CPU, etc.
*
`vmx_data_post`
(object of key/value strings) - Identical to
`vmx_data`
,
except that it is run after the virtual machine is shutdown, and before the
virtual machine is exported.
*
`vmx_template_path`
(string) - Path to a
[
configuration template
](
/docs/templates/configuration-templates.html
)
that
defines the contents of the virtual machine VMX file for VMware. This is
...
...
website/source/docs/builders/vmware-vmx.html.markdown
View file @
bdfac494
...
...
@@ -120,3 +120,7 @@ each category, the available options are alphabetized and described.
*
`vmx_data`
(object of key/value strings) - Arbitrary key/values
to enter into the virtual machine VMX file. This is for advanced users
who want to set properties such as memory, CPU, etc.
*
`vmx_data_post`
(object of key/value strings) - Identical to
`vmx_data`
,
except that it is run after the virtual machine is shutdown, and before the
virtual machine is exported.
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