Merge pull request #253 from phobos182/master
builder/amazon/common: added passing UserData to goamz.
This commit is contained in:
commit
4e300259c7
|
@ -13,6 +13,7 @@ type RunConfig struct {
|
||||||
SourceAmi string `mapstructure:"source_ami"`
|
SourceAmi string `mapstructure:"source_ami"`
|
||||||
IamInstanceProfile string `mapstructure:"iam_instance_profile"`
|
IamInstanceProfile string `mapstructure:"iam_instance_profile"`
|
||||||
InstanceType string `mapstructure:"instance_type"`
|
InstanceType string `mapstructure:"instance_type"`
|
||||||
|
UserData string `mapstructure:"user_data"`
|
||||||
RawSSHTimeout string `mapstructure:"ssh_timeout"`
|
RawSSHTimeout string `mapstructure:"ssh_timeout"`
|
||||||
SSHUsername string `mapstructure:"ssh_username"`
|
SSHUsername string `mapstructure:"ssh_username"`
|
||||||
SSHPort int `mapstructure:"ssh_port"`
|
SSHPort int `mapstructure:"ssh_port"`
|
||||||
|
|
|
@ -11,6 +11,7 @@ import (
|
||||||
type StepRunSourceInstance struct {
|
type StepRunSourceInstance struct {
|
||||||
ExpectedRootDevice string
|
ExpectedRootDevice string
|
||||||
InstanceType string
|
InstanceType string
|
||||||
|
UserData string
|
||||||
SourceAMI string
|
SourceAMI string
|
||||||
IamInstanceProfile string
|
IamInstanceProfile string
|
||||||
SubnetId string
|
SubnetId string
|
||||||
|
@ -28,6 +29,7 @@ func (s *StepRunSourceInstance) Run(state map[string]interface{}) multistep.Step
|
||||||
KeyName: keyName,
|
KeyName: keyName,
|
||||||
ImageId: s.SourceAMI,
|
ImageId: s.SourceAMI,
|
||||||
InstanceType: s.InstanceType,
|
InstanceType: s.InstanceType,
|
||||||
|
UserData: []byte(s.UserData),
|
||||||
MinCount: 0,
|
MinCount: 0,
|
||||||
MaxCount: 0,
|
MaxCount: 0,
|
||||||
SecurityGroups: []ec2.SecurityGroup{ec2.SecurityGroup{Id: securityGroupId}},
|
SecurityGroups: []ec2.SecurityGroup{ec2.SecurityGroup{Id: securityGroupId}},
|
||||||
|
|
|
@ -114,6 +114,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
|
||||||
&awscommon.StepRunSourceInstance{
|
&awscommon.StepRunSourceInstance{
|
||||||
ExpectedRootDevice: "ebs",
|
ExpectedRootDevice: "ebs",
|
||||||
InstanceType: b.config.InstanceType,
|
InstanceType: b.config.InstanceType,
|
||||||
|
UserData: b.config.UserData,
|
||||||
SourceAMI: b.config.SourceAmi,
|
SourceAMI: b.config.SourceAmi,
|
||||||
IamInstanceProfile: b.config.IamInstanceProfile,
|
IamInstanceProfile: b.config.IamInstanceProfile,
|
||||||
SubnetId: b.config.SubnetId,
|
SubnetId: b.config.SubnetId,
|
||||||
|
|
|
@ -193,6 +193,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
|
||||||
&awscommon.StepRunSourceInstance{
|
&awscommon.StepRunSourceInstance{
|
||||||
ExpectedRootDevice: "instance-store",
|
ExpectedRootDevice: "instance-store",
|
||||||
InstanceType: b.config.InstanceType,
|
InstanceType: b.config.InstanceType,
|
||||||
|
UserData: b.config.UserData,
|
||||||
SourceAMI: b.config.SourceAmi,
|
SourceAMI: b.config.SourceAmi,
|
||||||
SubnetId: b.config.SubnetId,
|
SubnetId: b.config.SubnetId,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue