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
5fac6c79
Commit
5fac6c79
authored
Apr 26, 2014
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fmt
parent
e84e5e4f
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
42 additions
and
42 deletions
+42
-42
builder/googlecompute/config.go
builder/googlecompute/config.go
+1
-1
builder/googlecompute/driver_gce.go
builder/googlecompute/driver_gce.go
+5
-5
builder/virtualbox/common/ssh.go
builder/virtualbox/common/ssh.go
+1
-1
builder/vmware/iso/step_upload_tools.go
builder/vmware/iso/step_upload_tools.go
+1
-1
common/config.go
common/config.go
+6
-6
common/config_test.go
common/config_test.go
+1
-1
communicator/ssh/password.go
communicator/ssh/password.go
+5
-5
post-processor/docker-push/post-processor_test.go
post-processor/docker-push/post-processor_test.go
+3
-3
provisioner/chef-client/provisioner.go
provisioner/chef-client/provisioner.go
+19
-19
No files found.
builder/googlecompute/config.go
View file @
5fac6c79
...
@@ -5,8 +5,8 @@ import (
...
@@ -5,8 +5,8 @@ import (
"fmt"
"fmt"
"time"
"time"
"github.com/mitchellh/packer/common/uuid"
"github.com/mitchellh/packer/common"
"github.com/mitchellh/packer/common"
"github.com/mitchellh/packer/common/uuid"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/packer"
)
)
...
...
builder/googlecompute/driver_gce.go
View file @
5fac6c79
...
@@ -170,13 +170,13 @@ func (d *driverGCE) RunInstance(c *InstanceConfig) (<-chan error, error) {
...
@@ -170,13 +170,13 @@ func (d *driverGCE) RunInstance(c *InstanceConfig) (<-chan error, error) {
Description
:
c
.
Description
,
Description
:
c
.
Description
,
Disks
:
[]
*
compute
.
AttachedDisk
{
Disks
:
[]
*
compute
.
AttachedDisk
{
&
compute
.
AttachedDisk
{
&
compute
.
AttachedDisk
{
Type
:
"PERSISTENT"
,
Type
:
"PERSISTENT"
,
Mode
:
"READ_WRITE"
,
Mode
:
"READ_WRITE"
,
Kind
:
"compute#attachedDisk"
,
Kind
:
"compute#attachedDisk"
,
Boot
:
true
,
Boot
:
true
,
AutoDelete
:
true
,
AutoDelete
:
true
,
InitializeParams
:
&
compute
.
AttachedDiskInitializeParams
{
InitializeParams
:
&
compute
.
AttachedDiskInitializeParams
{
SourceImage
:
image
.
SelfLink
,
SourceImage
:
image
.
SelfLink
,
},
},
},
},
},
},
...
...
builder/virtualbox/common/ssh.go
View file @
5fac6c79
...
@@ -27,7 +27,7 @@ func SSHConfigFunc(config SSHConfig) func(multistep.StateBag) (*gossh.ClientConf
...
@@ -27,7 +27,7 @@ func SSHConfigFunc(config SSHConfig) func(multistep.StateBag) (*gossh.ClientConf
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
auth
=
append
(
auth
,
gossh
.
PublicKeys
(
signer
))
auth
=
append
(
auth
,
gossh
.
PublicKeys
(
signer
))
}
}
...
...
builder/vmware/iso/step_upload_tools.go
View file @
5fac6c79
...
@@ -3,8 +3,8 @@ package iso
...
@@ -3,8 +3,8 @@ package iso
import
(
import
(
"fmt"
"fmt"
"github.com/mitchellh/multistep"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
vmwcommon
"github.com/mitchellh/packer/builder/vmware/common"
vmwcommon
"github.com/mitchellh/packer/builder/vmware/common"
"github.com/mitchellh/packer/packer"
"os"
"os"
)
)
...
...
common/config.go
View file @
5fac6c79
...
@@ -47,13 +47,13 @@ func CheckUnusedConfig(md *mapstructure.Metadata) *packer.MultiError {
...
@@ -47,13 +47,13 @@ func CheckUnusedConfig(md *mapstructure.Metadata) *packer.MultiError {
// ChooseString returns the first non-empty value.
// ChooseString returns the first non-empty value.
func
ChooseString
(
vals
...
string
)
string
{
func
ChooseString
(
vals
...
string
)
string
{
for
_
,
el
:=
range
vals
{
for
_
,
el
:=
range
vals
{
if
el
!=
""
{
if
el
!=
""
{
return
el
return
el
}
}
}
}
return
""
return
""
}
}
// DecodeConfig is a helper that handles decoding raw configuration using
// DecodeConfig is a helper that handles decoding raw configuration using
...
...
common/config_test.go
View file @
5fac6c79
...
@@ -31,7 +31,7 @@ func TestCheckUnusedConfig(t *testing.T) {
...
@@ -31,7 +31,7 @@ func TestCheckUnusedConfig(t *testing.T) {
func
TestChooseString
(
t
*
testing
.
T
)
{
func
TestChooseString
(
t
*
testing
.
T
)
{
cases
:=
[]
struct
{
cases
:=
[]
struct
{
Input
[]
string
Input
[]
string
Output
string
Output
string
}{
}{
{
{
...
...
communicator/ssh/password.go
View file @
5fac6c79
package
ssh
package
ssh
import
(
import
(
"log"
"code.google.com/p/go.crypto/ssh"
"code.google.com/p/go.crypto/ssh"
"log"
)
)
// An implementation of ssh.KeyboardInteractiveChallenge that simply sends
// An implementation of ssh.KeyboardInteractiveChallenge that simply sends
// back the password for all questions. The questions are logged.
// back the password for all questions. The questions are logged.
func
PasswordKeyboardInteractive
(
password
string
)
(
ssh
.
KeyboardInteractiveChallenge
)
{
func
PasswordKeyboardInteractive
(
password
string
)
ssh
.
KeyboardInteractiveChallenge
{
return
func
(
user
,
instruction
string
,
questions
[]
string
,
echos
[]
bool
)
([]
string
,
error
)
{
return
func
(
user
,
instruction
string
,
questions
[]
string
,
echos
[]
bool
)
([]
string
,
error
)
{
log
.
Printf
(
"Keyboard interactive challenge: "
)
log
.
Printf
(
"Keyboard interactive challenge: "
)
log
.
Printf
(
"-- User: %s"
,
user
)
log
.
Printf
(
"-- User: %s"
,
user
)
log
.
Printf
(
"-- Instructions: %s"
,
instruction
)
log
.
Printf
(
"-- Instructions: %s"
,
instruction
)
for
i
,
question
:=
range
questions
{
for
i
,
question
:=
range
questions
{
log
.
Printf
(
"-- Question %d: %s"
,
i
+
1
,
question
)
log
.
Printf
(
"-- Question %d: %s"
,
i
+
1
,
question
)
}
}
// Just send the password back for all questions
// Just send the password back for all questions
answers
:=
make
([]
string
,
len
(
questions
))
answers
:=
make
([]
string
,
len
(
questions
))
for
i
,
_
:=
range
answers
{
for
i
,
_
:=
range
answers
{
answers
[
i
]
=
string
(
password
)
answers
[
i
]
=
string
(
password
)
}
}
return
answers
,
nil
return
answers
,
nil
}
}
}
}
post-processor/docker-push/post-processor_test.go
View file @
5fac6c79
...
@@ -37,7 +37,7 @@ func TestPostProcessor_PostProcess(t *testing.T) {
...
@@ -37,7 +37,7 @@ func TestPostProcessor_PostProcess(t *testing.T) {
p
:=
&
PostProcessor
{
Driver
:
driver
}
p
:=
&
PostProcessor
{
Driver
:
driver
}
artifact
:=
&
packer
.
MockArtifact
{
artifact
:=
&
packer
.
MockArtifact
{
BuilderIdValue
:
dockerimport
.
BuilderId
,
BuilderIdValue
:
dockerimport
.
BuilderId
,
IdValue
:
"foo/bar"
,
IdValue
:
"foo/bar"
,
}
}
result
,
keep
,
err
:=
p
.
PostProcess
(
testUi
(),
artifact
)
result
,
keep
,
err
:=
p
.
PostProcess
(
testUi
(),
artifact
)
...
@@ -64,7 +64,7 @@ func TestPostProcessor_PostProcess_portInName(t *testing.T) {
...
@@ -64,7 +64,7 @@ func TestPostProcessor_PostProcess_portInName(t *testing.T) {
p
:=
&
PostProcessor
{
Driver
:
driver
}
p
:=
&
PostProcessor
{
Driver
:
driver
}
artifact
:=
&
packer
.
MockArtifact
{
artifact
:=
&
packer
.
MockArtifact
{
BuilderIdValue
:
dockerimport
.
BuilderId
,
BuilderIdValue
:
dockerimport
.
BuilderId
,
IdValue
:
"localhost:5000/foo/bar"
,
IdValue
:
"localhost:5000/foo/bar"
,
}
}
result
,
keep
,
err
:=
p
.
PostProcess
(
testUi
(),
artifact
)
result
,
keep
,
err
:=
p
.
PostProcess
(
testUi
(),
artifact
)
...
@@ -91,7 +91,7 @@ func TestPostProcessor_PostProcess_tags(t *testing.T) {
...
@@ -91,7 +91,7 @@ func TestPostProcessor_PostProcess_tags(t *testing.T) {
p
:=
&
PostProcessor
{
Driver
:
driver
}
p
:=
&
PostProcessor
{
Driver
:
driver
}
artifact
:=
&
packer
.
MockArtifact
{
artifact
:=
&
packer
.
MockArtifact
{
BuilderIdValue
:
dockerimport
.
BuilderId
,
BuilderIdValue
:
dockerimport
.
BuilderId
,
IdValue
:
"hashicorp/ubuntu:precise"
,
IdValue
:
"hashicorp/ubuntu:precise"
,
}
}
result
,
keep
,
err
:=
p
.
PostProcess
(
testUi
(),
artifact
)
result
,
keep
,
err
:=
p
.
PostProcess
(
testUi
(),
artifact
)
...
...
provisioner/chef-client/provisioner.go
View file @
5fac6c79
...
@@ -20,19 +20,19 @@ import (
...
@@ -20,19 +20,19 @@ import (
type
Config
struct
{
type
Config
struct
{
common
.
PackerConfig
`mapstructure:",squash"`
common
.
PackerConfig
`mapstructure:",squash"`
ConfigTemplate
string
`mapstructure:"config_template"`
ConfigTemplate
string
`mapstructure:"config_template"`
ExecuteCommand
string
`mapstructure:"execute_command"`
ExecuteCommand
string
`mapstructure:"execute_command"`
InstallCommand
string
`mapstructure:"install_command"`
InstallCommand
string
`mapstructure:"install_command"`
Json
map
[
string
]
interface
{}
Json
map
[
string
]
interface
{}
NodeName
string
`mapstructure:"node_name"`
NodeName
string
`mapstructure:"node_name"`
PreventSudo
bool
`mapstructure:"prevent_sudo"`
PreventSudo
bool
`mapstructure:"prevent_sudo"`
RunList
[]
string
`mapstructure:"run_list"`
RunList
[]
string
`mapstructure:"run_list"`
ServerUrl
string
`mapstructure:"server_url"`
ServerUrl
string
`mapstructure:"server_url"`
SkipCleanClient
bool
`mapstructure:"skip_clean_client"`
SkipCleanClient
bool
`mapstructure:"skip_clean_client"`
SkipCleanNode
bool
`mapstructure:"skip_clean_node"`
SkipCleanNode
bool
`mapstructure:"skip_clean_node"`
SkipInstall
bool
`mapstructure:"skip_install"`
SkipInstall
bool
`mapstructure:"skip_install"`
StagingDir
string
`mapstructure:"staging_directory"`
StagingDir
string
`mapstructure:"staging_directory"`
ValidationKeyPath
string
`mapstructure:"validation_key_path"`
ValidationKeyPath
string
`mapstructure:"validation_key_path"`
ValidationClientName
string
`mapstructure:"validation_client_name"`
ValidationClientName
string
`mapstructure:"validation_client_name"`
tpl
*
packer
.
ConfigTemplate
tpl
*
packer
.
ConfigTemplate
...
@@ -43,9 +43,9 @@ type Provisioner struct {
...
@@ -43,9 +43,9 @@ type Provisioner struct {
}
}
type
ConfigTemplate
struct
{
type
ConfigTemplate
struct
{
NodeName
string
NodeName
string
ServerUrl
string
ServerUrl
string
ValidationKeyPath
string
ValidationKeyPath
string
ValidationClientName
string
ValidationClientName
string
}
}
...
@@ -265,9 +265,9 @@ func (p *Provisioner) createConfig(ui packer.Ui, comm packer.Communicator, nodeN
...
@@ -265,9 +265,9 @@ func (p *Provisioner) createConfig(ui packer.Ui, comm packer.Communicator, nodeN
}
}
configString
,
err
:=
p
.
config
.
tpl
.
Process
(
tpl
,
&
ConfigTemplate
{
configString
,
err
:=
p
.
config
.
tpl
.
Process
(
tpl
,
&
ConfigTemplate
{
NodeName
:
nodeName
,
NodeName
:
nodeName
,
ServerUrl
:
serverUrl
,
ServerUrl
:
serverUrl
,
ValidationKeyPath
:
remoteKeyPath
,
ValidationKeyPath
:
remoteKeyPath
,
ValidationClientName
:
validationClientName
,
ValidationClientName
:
validationClientName
,
})
})
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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