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 (
"fmt"
"time"
"github.com/mitchellh/packer/common/uuid"
"github.com/mitchellh/packer/common"
"github.com/mitchellh/packer/common/uuid"
"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) {
Description
:
c
.
Description
,
Disks
:
[]
*
compute
.
AttachedDisk
{
&
compute
.
AttachedDisk
{
Type
:
"PERSISTENT"
,
Mode
:
"READ_WRITE"
,
Kind
:
"compute#attachedDisk"
,
Boot
:
true
,
Type
:
"PERSISTENT"
,
Mode
:
"READ_WRITE"
,
Kind
:
"compute#attachedDisk"
,
Boot
:
true
,
AutoDelete
:
true
,
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
if
err
!=
nil
{
return
nil
,
err
}
auth
=
append
(
auth
,
gossh
.
PublicKeys
(
signer
))
}
...
...
builder/vmware/iso/step_upload_tools.go
View file @
5fac6c79
...
...
@@ -3,8 +3,8 @@ package iso
import
(
"fmt"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
vmwcommon
"github.com/mitchellh/packer/builder/vmware/common"
"github.com/mitchellh/packer/packer"
"os"
)
...
...
common/config.go
View file @
5fac6c79
...
...
@@ -47,13 +47,13 @@ func CheckUnusedConfig(md *mapstructure.Metadata) *packer.MultiError {
// ChooseString returns the first non-empty value.
func
ChooseString
(
vals
...
string
)
string
{
for
_
,
el
:=
range
vals
{
if
el
!=
""
{
return
el
}
}
for
_
,
el
:=
range
vals
{
if
el
!=
""
{
return
el
}
}
return
""
return
""
}
// 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) {
func
TestChooseString
(
t
*
testing
.
T
)
{
cases
:=
[]
struct
{
Input
[]
string
Input
[]
string
Output
string
}{
{
...
...
communicator/ssh/password.go
View file @
5fac6c79
package
ssh
import
(
"log"
"code.google.com/p/go.crypto/ssh"
"log"
)
// An implementation of ssh.KeyboardInteractiveChallenge that simply sends
// back the password for all questions. The questions are logged.
func
PasswordKeyboardInteractive
(
password
string
)
(
ssh
.
KeyboardInteractiveChallenge
)
{
return
func
(
user
,
instruction
string
,
questions
[]
string
,
echos
[]
bool
)
([]
string
,
error
)
{
func
PasswordKeyboardInteractive
(
password
string
)
ssh
.
KeyboardInteractiveChallenge
{
return
func
(
user
,
instruction
string
,
questions
[]
string
,
echos
[]
bool
)
([]
string
,
error
)
{
log
.
Printf
(
"Keyboard interactive challenge: "
)
log
.
Printf
(
"-- User: %s"
,
user
)
log
.
Printf
(
"-- Instructions: %s"
,
instruction
)
for
i
,
question
:=
range
questions
{
log
.
Printf
(
"-- Question %d: %s"
,
i
+
1
,
question
)
}
// Just send the password back for all questions
answers
:=
make
([]
string
,
len
(
questions
))
for
i
,
_
:=
range
answers
{
answers
[
i
]
=
string
(
password
)
}
return
answers
,
nil
}
}
post-processor/docker-push/post-processor_test.go
View file @
5fac6c79
...
...
@@ -37,7 +37,7 @@ func TestPostProcessor_PostProcess(t *testing.T) {
p
:=
&
PostProcessor
{
Driver
:
driver
}
artifact
:=
&
packer
.
MockArtifact
{
BuilderIdValue
:
dockerimport
.
BuilderId
,
IdValue
:
"foo/bar"
,
IdValue
:
"foo/bar"
,
}
result
,
keep
,
err
:=
p
.
PostProcess
(
testUi
(),
artifact
)
...
...
@@ -64,7 +64,7 @@ func TestPostProcessor_PostProcess_portInName(t *testing.T) {
p
:=
&
PostProcessor
{
Driver
:
driver
}
artifact
:=
&
packer
.
MockArtifact
{
BuilderIdValue
:
dockerimport
.
BuilderId
,
IdValue
:
"localhost:5000/foo/bar"
,
IdValue
:
"localhost:5000/foo/bar"
,
}
result
,
keep
,
err
:=
p
.
PostProcess
(
testUi
(),
artifact
)
...
...
@@ -91,7 +91,7 @@ func TestPostProcessor_PostProcess_tags(t *testing.T) {
p
:=
&
PostProcessor
{
Driver
:
driver
}
artifact
:=
&
packer
.
MockArtifact
{
BuilderIdValue
:
dockerimport
.
BuilderId
,
IdValue
:
"hashicorp/ubuntu:precise"
,
IdValue
:
"hashicorp/ubuntu:precise"
,
}
result
,
keep
,
err
:=
p
.
PostProcess
(
testUi
(),
artifact
)
...
...
provisioner/chef-client/provisioner.go
View file @
5fac6c79
...
...
@@ -20,19 +20,19 @@ import (
type
Config
struct
{
common
.
PackerConfig
`mapstructure:",squash"`
ConfigTemplate
string
`mapstructure:"config_template"`
ExecuteCommand
string
`mapstructure:"execute_command"`
InstallCommand
string
`mapstructure:"install_command"`
Json
map
[
string
]
interface
{}
NodeName
string
`mapstructure:"node_name"`
PreventSudo
bool
`mapstructure:"prevent_sudo"`
RunList
[]
string
`mapstructure:"run_list"`
ServerUrl
string
`mapstructure:"server_url"`
SkipCleanClient
bool
`mapstructure:"skip_clean_client"`
SkipCleanNode
bool
`mapstructure:"skip_clean_node"`
SkipInstall
bool
`mapstructure:"skip_install"`
StagingDir
string
`mapstructure:"staging_directory"`
ValidationKeyPath
string
`mapstructure:"validation_key_path"`
ConfigTemplate
string
`mapstructure:"config_template"`
ExecuteCommand
string
`mapstructure:"execute_command"`
InstallCommand
string
`mapstructure:"install_command"`
Json
map
[
string
]
interface
{}
NodeName
string
`mapstructure:"node_name"`
PreventSudo
bool
`mapstructure:"prevent_sudo"`
RunList
[]
string
`mapstructure:"run_list"`
ServerUrl
string
`mapstructure:"server_url"`
SkipCleanClient
bool
`mapstructure:"skip_clean_client"`
SkipCleanNode
bool
`mapstructure:"skip_clean_node"`
SkipInstall
bool
`mapstructure:"skip_install"`
StagingDir
string
`mapstructure:"staging_directory"`
ValidationKeyPath
string
`mapstructure:"validation_key_path"`
ValidationClientName
string
`mapstructure:"validation_client_name"`
tpl
*
packer
.
ConfigTemplate
...
...
@@ -43,9 +43,9 @@ type Provisioner struct {
}
type
ConfigTemplate
struct
{
NodeName
string
ServerUrl
string
ValidationKeyPath
string
NodeName
string
ServerUrl
string
ValidationKeyPath
string
ValidationClientName
string
}
...
...
@@ -265,9 +265,9 @@ func (p *Provisioner) createConfig(ui packer.Ui, comm packer.Communicator, nodeN
}
configString
,
err
:=
p
.
config
.
tpl
.
Process
(
tpl
,
&
ConfigTemplate
{
NodeName
:
nodeName
,
ServerUrl
:
serverUrl
,
ValidationKeyPath
:
remoteKeyPath
,
NodeName
:
nodeName
,
ServerUrl
:
serverUrl
,
ValidationKeyPath
:
remoteKeyPath
,
ValidationClientName
:
validationClientName
,
})
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