Testing adding user-data support to Packer

This commit is contained in:
Jeremy Carroll 2013-08-07 14:33:20 -07:00
parent 20d0479594
commit 4f02c506e9
4 changed files with 5 additions and 0 deletions

View File

@ -12,6 +12,7 @@ type RunConfig struct {
SourceAmi string `mapstructure:"source_ami"`
IamInstanceProfile string `mapstructure:"iam_instance_profile"`
InstanceType string `mapstructure:"instance_type"`
UserData string `mapstructure:"user_data"`
RawSSHTimeout string `mapstructure:"ssh_timeout"`
SSHUsername string `mapstructure:"ssh_username"`
SSHPort int `mapstructure:"ssh_port"`

View File

@ -11,6 +11,7 @@ import (
type StepRunSourceInstance struct {
ExpectedRootDevice string
InstanceType string
UserData string
SourceAMI string
IamInstanceProfile string
SubnetId string
@ -28,6 +29,7 @@ func (s *StepRunSourceInstance) Run(state map[string]interface{}) multistep.Step
KeyName: keyName,
ImageId: s.SourceAMI,
InstanceType: s.InstanceType,
UserData: s.UserData,
MinCount: 0,
MaxCount: 0,
SecurityGroups: []ec2.SecurityGroup{ec2.SecurityGroup{Id: securityGroupId}},

View File

@ -99,6 +99,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
&awscommon.StepRunSourceInstance{
ExpectedRootDevice: "ebs",
InstanceType: b.config.InstanceType,
UserData: b.config.UserData,
SourceAMI: b.config.SourceAmi,
IamInstanceProfile: b.config.IamInstanceProfile,
SubnetId: b.config.SubnetId,

View File

@ -164,6 +164,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
&awscommon.StepRunSourceInstance{
ExpectedRootDevice: "instance-store",
InstanceType: b.config.InstanceType,
UserData: b.config.UserData,
SourceAMI: b.config.SourceAmi,
SubnetId: b.config.SubnetId,
},