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
0776d9de
Commit
0776d9de
authored
Sep 04, 2014
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/amazon: ssh_private_ip [GH-1229]
parent
d2e24a4e
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
4 deletions
+15
-4
CHANGELOG.md
CHANGELOG.md
+2
-0
builder/amazon/common/run_config.go
builder/amazon/common/run_config.go
+1
-0
builder/amazon/common/ssh.go
builder/amazon/common/ssh.go
+2
-2
builder/amazon/ebs/builder.go
builder/amazon/ebs/builder.go
+2
-1
builder/amazon/instance/builder.go
builder/amazon/instance/builder.go
+2
-1
website/source/docs/builders/amazon-ebs.html.markdown
website/source/docs/builders/amazon-ebs.html.markdown
+3
-0
website/source/docs/builders/amazon-instance.html.markdown
website/source/docs/builders/amazon-instance.html.markdown
+3
-0
No files found.
CHANGELOG.md
View file @
0776d9de
...
@@ -15,6 +15,8 @@ IMPROVEMENTS:
...
@@ -15,6 +15,8 @@ IMPROVEMENTS:
*
builder/amazon/all:
`AWS_SECURITY_TOKEN`
is read and can also be
*
builder/amazon/all:
`AWS_SECURITY_TOKEN`
is read and can also be
set with the
`token`
configuration. [GH-1236]
set with the
`token`
configuration. [GH-1236]
*
builder/amazon/all: Can force SSH on the private IP address with
`ssh_private_ip`
. [GH-1229]
*
builder/amazon-instance: EBS AMIs can be used as a source. [GH-1453]
*
builder/amazon-instance: EBS AMIs can be used as a source. [GH-1453]
*
builder/digitalocean: Can set API URL endpoint. [GH-1448]
*
builder/digitalocean: Can set API URL endpoint. [GH-1448]
*
builder/digitalocean: Region supports variables. [GH-1452]
*
builder/digitalocean: Region supports variables. [GH-1452]
...
...
builder/amazon/common/run_config.go
View file @
0776d9de
...
@@ -20,6 +20,7 @@ type RunConfig struct {
...
@@ -20,6 +20,7 @@ type RunConfig struct {
RawSSHTimeout
string
`mapstructure:"ssh_timeout"`
RawSSHTimeout
string
`mapstructure:"ssh_timeout"`
SSHUsername
string
`mapstructure:"ssh_username"`
SSHUsername
string
`mapstructure:"ssh_username"`
SSHPrivateKeyFile
string
`mapstructure:"ssh_private_key_file"`
SSHPrivateKeyFile
string
`mapstructure:"ssh_private_key_file"`
SSHPrivateIp
bool
`mapstructure:"ssh_private_ip"`
SSHPort
int
`mapstructure:"ssh_port"`
SSHPort
int
`mapstructure:"ssh_port"`
SecurityGroupId
string
`mapstructure:"security_group_id"`
SecurityGroupId
string
`mapstructure:"security_group_id"`
SecurityGroupIds
[]
string
`mapstructure:"security_group_ids"`
SecurityGroupIds
[]
string
`mapstructure:"security_group_ids"`
...
...
builder/amazon/common/ssh.go
View file @
0776d9de
...
@@ -11,7 +11,7 @@ import (
...
@@ -11,7 +11,7 @@ import (
// SSHAddress returns a function that can be given to the SSH communicator
// SSHAddress returns a function that can be given to the SSH communicator
// for determining the SSH address based on the instance DNS name.
// for determining the SSH address based on the instance DNS name.
func
SSHAddress
(
e
*
ec2
.
EC2
,
port
int
)
func
(
multistep
.
StateBag
)
(
string
,
error
)
{
func
SSHAddress
(
e
*
ec2
.
EC2
,
port
int
,
private
bool
)
func
(
multistep
.
StateBag
)
(
string
,
error
)
{
return
func
(
state
multistep
.
StateBag
)
(
string
,
error
)
{
return
func
(
state
multistep
.
StateBag
)
(
string
,
error
)
{
for
j
:=
0
;
j
<
2
;
j
++
{
for
j
:=
0
;
j
<
2
;
j
++
{
var
host
string
var
host
string
...
@@ -19,7 +19,7 @@ func SSHAddress(e *ec2.EC2, port int) func(multistep.StateBag) (string, error) {
...
@@ -19,7 +19,7 @@ func SSHAddress(e *ec2.EC2, port int) func(multistep.StateBag) (string, error) {
if
i
.
DNSName
!=
""
{
if
i
.
DNSName
!=
""
{
host
=
i
.
DNSName
host
=
i
.
DNSName
}
else
if
i
.
VpcId
!=
""
{
}
else
if
i
.
VpcId
!=
""
{
if
i
.
PublicIpAddress
!=
""
{
if
i
.
PublicIpAddress
!=
""
&&
!
private
{
host
=
i
.
PublicIpAddress
host
=
i
.
PublicIpAddress
}
else
{
}
else
{
host
=
i
.
PrivateIpAddress
host
=
i
.
PrivateIpAddress
...
...
builder/amazon/ebs/builder.go
View file @
0776d9de
...
@@ -113,7 +113,8 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
...
@@ -113,7 +113,8 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
Tags
:
b
.
config
.
RunTags
,
Tags
:
b
.
config
.
RunTags
,
},
},
&
common
.
StepConnectSSH
{
&
common
.
StepConnectSSH
{
SSHAddress
:
awscommon
.
SSHAddress
(
ec2conn
,
b
.
config
.
SSHPort
),
SSHAddress
:
awscommon
.
SSHAddress
(
ec2conn
,
b
.
config
.
SSHPort
,
b
.
config
.
SSHPrivateIp
),
SSHConfig
:
awscommon
.
SSHConfig
(
b
.
config
.
SSHUsername
),
SSHConfig
:
awscommon
.
SSHConfig
(
b
.
config
.
SSHUsername
),
SSHWaitTimeout
:
b
.
config
.
SSHTimeout
(),
SSHWaitTimeout
:
b
.
config
.
SSHTimeout
(),
},
},
...
...
builder/amazon/instance/builder.go
View file @
0776d9de
...
@@ -216,7 +216,8 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
...
@@ -216,7 +216,8 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
Tags
:
b
.
config
.
RunTags
,
Tags
:
b
.
config
.
RunTags
,
},
},
&
common
.
StepConnectSSH
{
&
common
.
StepConnectSSH
{
SSHAddress
:
awscommon
.
SSHAddress
(
ec2conn
,
b
.
config
.
SSHPort
),
SSHAddress
:
awscommon
.
SSHAddress
(
ec2conn
,
b
.
config
.
SSHPort
,
b
.
config
.
SSHPrivateIp
),
SSHConfig
:
awscommon
.
SSHConfig
(
b
.
config
.
SSHUsername
),
SSHConfig
:
awscommon
.
SSHConfig
(
b
.
config
.
SSHUsername
),
SSHWaitTimeout
:
b
.
config
.
SSHTimeout
(),
SSHWaitTimeout
:
b
.
config
.
SSHTimeout
(),
},
},
...
...
website/source/docs/builders/amazon-ebs.html.markdown
View file @
0776d9de
...
@@ -126,6 +126,9 @@ each category, the available configuration keys are alphabetized.
...
@@ -126,6 +126,9 @@ each category, the available configuration keys are alphabetized.
*
`ssh_private_key_file`
(string) - Use this ssh private key file instead of
*
`ssh_private_key_file`
(string) - Use this ssh private key file instead of
a generated ssh key pair for connecting to the instance.
a generated ssh key pair for connecting to the instance.
*
`ssh_private_ip`
(bool) - If true, then SSH will always use the private
IP if available.
*
`ssh_timeout`
(string) - The time to wait for SSH to become available
*
`ssh_timeout`
(string) - The time to wait for SSH to become available
before timing out. The format of this value is a duration such as "5s"
before timing out. The format of this value is a duration such as "5s"
or "5m". The default SSH timeout is "5m", or five minutes.
or "5m". The default SSH timeout is "5m", or five minutes.
...
...
website/source/docs/builders/amazon-instance.html.markdown
View file @
0776d9de
...
@@ -164,6 +164,9 @@ each category, the available configuration keys are alphabetized.
...
@@ -164,6 +164,9 @@ each category, the available configuration keys are alphabetized.
*
`ssh_private_key_file`
(string) - Use this ssh private key file instead of
*
`ssh_private_key_file`
(string) - Use this ssh private key file instead of
a generated ssh key pair for connecting to the instance.
a generated ssh key pair for connecting to the instance.
*
`ssh_private_ip`
(bool) - If true, then SSH will always use the private
IP if available.
*
`ssh_timeout`
(string) - The time to wait for SSH to become available
*
`ssh_timeout`
(string) - The time to wait for SSH to become available
before timing out. The format of this value is a duration such as "5s"
before timing out. The format of this value is a duration such as "5s"
or "5m". The default SSH timeout is "5m", or five minutes.
or "5m". The default SSH timeout is "5m", or five minutes.
...
...
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