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
e9a491ae
Commit
e9a491ae
authored
Jun 04, 2015
by
Shawn Neal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New interpolation for additional vmware disks
parent
b665339b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
builder/vmware/iso/step_create_vmx.go
builder/vmware/iso/step_create_vmx.go
+12
-11
No files found.
builder/vmware/iso/step_create_vmx.go
View file @
e9a491ae
...
...
@@ -45,15 +45,6 @@ func (s *stepCreateVMX) Run(state multistep.StateBag) multistep.StepAction {
ui
.
Say
(
"Building and writing VMX file"
)
ctx
:=
config
.
ctx
ctx
.
Data
=
&
vmxTemplateData
{
Name
:
config
.
VMName
,
GuestOS
:
config
.
GuestOSType
,
DiskName
:
config
.
DiskName
,
Version
:
config
.
Version
,
ISOPath
:
isoPath
,
}
vmxTemplate
:=
DefaultVMXTemplate
if
config
.
VMXTemplatePath
!=
""
{
f
,
err
:=
os
.
Open
(
config
.
VMXTemplatePath
)
...
...
@@ -76,14 +67,16 @@ func (s *stepCreateVMX) Run(state multistep.StateBag) multistep.StepAction {
vmxTemplate
=
string
(
rawBytes
)
}
ctx
:=
config
.
ctx
if
len
(
config
.
AdditionalDiskSize
)
>
0
{
for
i
,
_
:=
range
config
.
AdditionalDiskSize
{
data
:
=
&
additionalDiskTemplateData
{
ctx
.
Data
=
&
additionalDiskTemplateData
{
DiskNumber
:
i
+
1
,
DiskName
:
config
.
DiskName
,
}
diskTemplate
,
err
:=
config
.
tpl
.
Process
(
DefaultAdditionalDiskTemplate
,
data
)
diskTemplate
,
err
:=
interpolate
.
Render
(
DefaultAdditionalDiskTemplate
,
&
ctx
)
if
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error preparing VMX template for additional disk: %s"
,
err
)
state
.
Put
(
"error"
,
err
)
...
...
@@ -95,6 +88,14 @@ func (s *stepCreateVMX) Run(state multistep.StateBag) multistep.StepAction {
}
}
ctx
.
Data
=
&
vmxTemplateData
{
Name
:
config
.
VMName
,
GuestOS
:
config
.
GuestOSType
,
DiskName
:
config
.
DiskName
,
Version
:
config
.
Version
,
ISOPath
:
isoPath
,
}
vmxContents
,
err
:=
interpolate
.
Render
(
vmxTemplate
,
&
ctx
)
if
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error procesing VMX template: %s"
,
err
)
...
...
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