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
eeadafc4
Commit
eeadafc4
authored
Dec 27, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/vmware/*: can specify path to fusion [GH-677]
parent
525802e9
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
80 additions
and
5 deletions
+80
-5
CHANGELOG.md
CHANGELOG.md
+1
-0
builder/vmware/common/driver.go
builder/vmware/common/driver.go
+3
-3
builder/vmware/common/driver_config.go
builder/vmware/common/driver_config.go
+32
-0
builder/vmware/common/driver_config_test.go
builder/vmware/common/driver_config_test.go
+30
-0
builder/vmware/iso/builder.go
builder/vmware/iso/builder.go
+2
-0
builder/vmware/iso/driver.go
builder/vmware/iso/driver.go
+1
-1
builder/vmware/vmx/builder.go
builder/vmware/vmx/builder.go
+1
-1
builder/vmware/vmx/config.go
builder/vmware/vmx/config.go
+2
-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.
CHANGELOG.md
View file @
eeadafc4
...
...
@@ -52,6 +52,7 @@ IMPROVEMENTS:
*
builder/virtualbox: Nice errors if Packer can't write to
the output directory.
*
builder/virtualbox: ISO is ejected prior to export.
*
builder/vmware: Can now specify path to the Fusion application. [GH-677]
*
provisioner/puppet-masterless: Can now specify a
`manifest_dir`
to
upload manifests to the remote machine for imports. [GH-655]
...
...
builder/vmware/common/driver.go
View file @
eeadafc4
...
...
@@ -56,7 +56,7 @@ type Driver interface {
// NewDriver returns a new driver implementation for this operating
// system, or an error if the driver couldn't be initialized.
func
NewDriver
(
config
*
SSHConfig
)
(
Driver
,
error
)
{
func
NewDriver
(
dconfig
*
DriverConfig
,
config
*
SSHConfig
)
(
Driver
,
error
)
{
drivers
:=
[]
Driver
{}
switch
runtime
.
GOOS
{
...
...
@@ -64,12 +64,12 @@ func NewDriver(config *SSHConfig) (Driver, error) {
drivers
=
[]
Driver
{
&
Fusion6Driver
{
Fusion5Driver
:
Fusion5Driver
{
AppPath
:
"/Applications/VMware Fusion.app"
,
AppPath
:
dconfig
.
FusionAppPath
,
SSHConfig
:
config
,
},
},
&
Fusion5Driver
{
AppPath
:
"/Applications/VMware Fusion.app"
,
AppPath
:
dconfig
.
FusionAppPath
,
SSHConfig
:
config
,
},
}
...
...
builder/vmware/common/driver_config.go
0 → 100644
View file @
eeadafc4
package
common
import
(
"fmt"
"github.com/mitchellh/packer/packer"
)
type
DriverConfig
struct
{
FusionAppPath
string
`mapstructure:"fusion_app_path"`
}
func
(
c
*
DriverConfig
)
Prepare
(
t
*
packer
.
ConfigTemplate
)
[]
error
{
if
c
.
FusionAppPath
==
""
{
c
.
FusionAppPath
=
"/Applications/VMware Fusion.app"
}
templates
:=
map
[
string
]
*
string
{
"fusion_app_path"
:
&
c
.
FusionAppPath
,
}
var
err
error
errs
:=
make
([]
error
,
0
)
for
n
,
ptr
:=
range
templates
{
*
ptr
,
err
=
t
.
Process
(
*
ptr
,
nil
)
if
err
!=
nil
{
errs
=
append
(
errs
,
fmt
.
Errorf
(
"Error processing %s: %s"
,
n
,
err
))
}
}
return
errs
}
builder/vmware/common/driver_config_test.go
0 → 100644
View file @
eeadafc4
package
common
import
(
"testing"
)
func
TestDriverConfigPrepare
(
t
*
testing
.
T
)
{
var
c
*
DriverConfig
// Test a default boot_wait
c
=
new
(
DriverConfig
)
errs
:=
c
.
Prepare
(
testConfigTemplate
(
t
))
if
len
(
errs
)
>
0
{
t
.
Fatalf
(
"bad: %#v"
,
errs
)
}
if
c
.
FusionAppPath
!=
"/Applications/VMware Fusion.app"
{
t
.
Fatalf
(
"bad value: %s"
,
c
.
FusionAppPath
)
}
// Test with a good one
c
=
new
(
DriverConfig
)
c
.
FusionAppPath
=
"foo"
errs
=
c
.
Prepare
(
testConfigTemplate
(
t
))
if
len
(
errs
)
>
0
{
t
.
Fatalf
(
"bad: %#v"
,
errs
)
}
if
c
.
FusionAppPath
!=
"foo"
{
t
.
Fatalf
(
"bad value: %s"
,
c
.
FusionAppPath
)
}
}
builder/vmware/iso/builder.go
View file @
eeadafc4
...
...
@@ -25,6 +25,7 @@ type Builder struct {
type
config
struct
{
common
.
PackerConfig
`mapstructure:",squash"`
vmwcommon
.
DriverConfig
`mapstructure:",squash"`
vmwcommon
.
OutputConfig
`mapstructure:",squash"`
vmwcommon
.
RunConfig
`mapstructure:",squash"`
vmwcommon
.
ShutdownConfig
`mapstructure:",squash"`
...
...
@@ -77,6 +78,7 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
// Accumulate any errors
errs
:=
common
.
CheckUnusedConfig
(
md
)
errs
=
packer
.
MultiErrorAppend
(
errs
,
b
.
config
.
DriverConfig
.
Prepare
(
b
.
config
.
tpl
)
...
)
errs
=
packer
.
MultiErrorAppend
(
errs
,
b
.
config
.
OutputConfig
.
Prepare
(
b
.
config
.
tpl
,
&
b
.
config
.
PackerConfig
)
...
)
errs
=
packer
.
MultiErrorAppend
(
errs
,
b
.
config
.
RunConfig
.
Prepare
(
b
.
config
.
tpl
)
...
)
...
...
builder/vmware/iso/driver.go
View file @
eeadafc4
...
...
@@ -12,7 +12,7 @@ func NewDriver(config *config) (vmwcommon.Driver, error) {
drivers
:=
[]
vmwcommon
.
Driver
{}
if
config
.
RemoteType
==
""
{
return
vmwcommon
.
NewDriver
(
&
config
.
SSHConfig
)
return
vmwcommon
.
NewDriver
(
&
config
.
DriverConfig
,
&
config
.
SSHConfig
)
}
drivers
=
[]
vmwcommon
.
Driver
{
...
...
builder/vmware/vmx/builder.go
View file @
eeadafc4
...
...
@@ -33,7 +33,7 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
// Run executes a Packer build and returns a packer.Artifact representing
// a VirtualBox appliance.
func
(
b
*
Builder
)
Run
(
ui
packer
.
Ui
,
hook
packer
.
Hook
,
cache
packer
.
Cache
)
(
packer
.
Artifact
,
error
)
{
driver
,
err
:=
vmwcommon
.
NewDriver
(
&
b
.
config
.
SSHConfig
)
driver
,
err
:=
vmwcommon
.
NewDriver
(
&
b
.
config
.
DriverConfig
,
&
b
.
config
.
SSHConfig
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"Failed creating VMware driver: %s"
,
err
)
}
...
...
builder/vmware/vmx/config.go
View file @
eeadafc4
...
...
@@ -12,6 +12,7 @@ import (
// Config is the configuration structure for the builder.
type
Config
struct
{
common
.
PackerConfig
`mapstructure:",squash"`
vmwcommon
.
DriverConfig
`mapstructure:",squash"`
vmwcommon
.
OutputConfig
`mapstructure:",squash"`
vmwcommon
.
RunConfig
`mapstructure:",squash"`
vmwcommon
.
ShutdownConfig
`mapstructure:",squash"`
...
...
@@ -45,6 +46,7 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) {
// Prepare the errors
errs
:=
common
.
CheckUnusedConfig
(
md
)
errs
=
packer
.
MultiErrorAppend
(
errs
,
c
.
DriverConfig
.
Prepare
(
c
.
tpl
)
...
)
errs
=
packer
.
MultiErrorAppend
(
errs
,
c
.
OutputConfig
.
Prepare
(
c
.
tpl
,
&
c
.
PackerConfig
)
...
)
errs
=
packer
.
MultiErrorAppend
(
errs
,
c
.
RunConfig
.
Prepare
(
c
.
tpl
)
...
)
errs
=
packer
.
MultiErrorAppend
(
errs
,
c
.
ShutdownConfig
.
Prepare
(
c
.
tpl
)
...
)
...
...
website/source/docs/builders/vmware-iso.html.markdown
View file @
eeadafc4
...
...
@@ -99,6 +99,10 @@ Optional:
be attached. The files listed in this configuration will all be put
into the root directory of the floppy disk; sub-directories are not supported.
*
`fusion_app_path`
(string) - Path to "VMware Fusion.app". By default this
is "/Applications/VMware Fusion.app" but this setting allows you to
customize this.
*
`guest_os_type`
(string) - The guest OS type being installed. This will be
set in the VMware VMX. By default this is "other". By specifying a more specific
OS type, VMware may perform some optimizations or virtual hardware changes
...
...
website/source/docs/builders/vmware-vmx.html.markdown
View file @
eeadafc4
...
...
@@ -64,6 +64,10 @@ Optional:
be attached. The files listed in this configuration will all be put
into the root directory of the floppy disk; sub-directories are not supported.
*
`fusion_app_path`
(string) - Path to "VMware Fusion.app". By default this
is "/Applications/VMware Fusion.app" but this setting allows you to
customize this.
*
`headless`
(bool) - Packer defaults to building VMware
virtual machines by launching a GUI that shows the console of the
machine being built. When this value is set to true, the machine will
...
...
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