builder/amazon: output DNS name if debug mode
This commit is contained in:
parent
57f185451a
commit
9186a7f214
@ -4,6 +4,7 @@ IMPROVEMENTS:
|
|||||||
|
|
||||||
* builder/amazon: In `-debug` mode, the keypair used will be saved to
|
* builder/amazon: In `-debug` mode, the keypair used will be saved to
|
||||||
the current directory so you can access the machine. [GH-373]
|
the current directory so you can access the machine. [GH-373]
|
||||||
|
* builder/amazon: In `-debug` mode, the DNS is outputted.
|
||||||
|
|
||||||
BUG FIXES:
|
BUG FIXES:
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type StepRunSourceInstance struct {
|
type StepRunSourceInstance struct {
|
||||||
|
Debug bool
|
||||||
ExpectedRootDevice string
|
ExpectedRootDevice string
|
||||||
InstanceType string
|
InstanceType string
|
||||||
UserData string
|
UserData string
|
||||||
@ -100,6 +101,17 @@ func (s *StepRunSourceInstance) Run(state map[string]interface{}) multistep.Step
|
|||||||
}
|
}
|
||||||
|
|
||||||
s.instance = latestInstance.(*ec2.Instance)
|
s.instance = latestInstance.(*ec2.Instance)
|
||||||
|
|
||||||
|
if s.Debug {
|
||||||
|
if s.instance.DNSName != "" {
|
||||||
|
ui.Message(fmt.Sprintf("Public DNS: %s", s.instance.DNSName))
|
||||||
|
}
|
||||||
|
|
||||||
|
if s.instance.PrivateIpAddress != "" {
|
||||||
|
ui.Message(fmt.Sprintf("Private IP: %s", s.instance.PrivateIpAddress))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
state["instance"] = s.instance
|
state["instance"] = s.instance
|
||||||
|
|
||||||
return multistep.ActionContinue
|
return multistep.ActionContinue
|
||||||
|
@ -91,6 +91,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
|
|||||||
VpcId: b.config.VpcId,
|
VpcId: b.config.VpcId,
|
||||||
},
|
},
|
||||||
&awscommon.StepRunSourceInstance{
|
&awscommon.StepRunSourceInstance{
|
||||||
|
Debug: b.config.PackerDebug,
|
||||||
ExpectedRootDevice: "ebs",
|
ExpectedRootDevice: "ebs",
|
||||||
InstanceType: b.config.InstanceType,
|
InstanceType: b.config.InstanceType,
|
||||||
UserData: b.config.UserData,
|
UserData: b.config.UserData,
|
||||||
|
@ -194,6 +194,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
|
|||||||
VpcId: b.config.VpcId,
|
VpcId: b.config.VpcId,
|
||||||
},
|
},
|
||||||
&awscommon.StepRunSourceInstance{
|
&awscommon.StepRunSourceInstance{
|
||||||
|
Debug: b.config.PackerDebug,
|
||||||
ExpectedRootDevice: "instance-store",
|
ExpectedRootDevice: "instance-store",
|
||||||
InstanceType: b.config.InstanceType,
|
InstanceType: b.config.InstanceType,
|
||||||
IamInstanceProfile: b.config.IamInstanceProfile,
|
IamInstanceProfile: b.config.IamInstanceProfile,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user