Add SSMTunnel step to other amazon builders, minus chroot
This commit is contained in:
parent
743df19af2
commit
3f6b28b70c
|
@ -257,9 +257,10 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
||||||
BuildName: b.config.PackerBuildName,
|
BuildName: b.config.PackerBuildName,
|
||||||
},
|
},
|
||||||
&awscommon.StepCreateSSMTunnel{
|
&awscommon.StepCreateSSMTunnel{
|
||||||
AWSSession: session,
|
AWSSession: session,
|
||||||
DstPort: b.config.Comm.Port(),
|
Region: *ec2conn.Config.Region,
|
||||||
SSMAgentEnabled: b.config.SSMAgentEnabled(),
|
RemotePortNumber: b.config.Comm.Port(),
|
||||||
|
SSMAgentEnabled: b.config.SSMAgentEnabled(),
|
||||||
},
|
},
|
||||||
&communicator.StepConnect{
|
&communicator.StepConnect{
|
||||||
// StepConnect is provided settings for WinRM and SSH, but
|
// StepConnect is provided settings for WinRM and SSH, but
|
||||||
|
|
|
@ -262,6 +262,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
||||||
SecurityGroupIds: b.config.SecurityGroupIds,
|
SecurityGroupIds: b.config.SecurityGroupIds,
|
||||||
CommConfig: &b.config.RunConfig.Comm,
|
CommConfig: &b.config.RunConfig.Comm,
|
||||||
TemporarySGSourceCidrs: b.config.TemporarySGSourceCidrs,
|
TemporarySGSourceCidrs: b.config.TemporarySGSourceCidrs,
|
||||||
|
SkipSSHRuleCreation: b.config.SSMAgentEnabled(),
|
||||||
},
|
},
|
||||||
&awscommon.StepIamInstanceProfile{
|
&awscommon.StepIamInstanceProfile{
|
||||||
IamInstanceProfile: b.config.IamInstanceProfile,
|
IamInstanceProfile: b.config.IamInstanceProfile,
|
||||||
|
@ -278,6 +279,12 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
||||||
Timeout: b.config.WindowsPasswordTimeout,
|
Timeout: b.config.WindowsPasswordTimeout,
|
||||||
BuildName: b.config.PackerBuildName,
|
BuildName: b.config.PackerBuildName,
|
||||||
},
|
},
|
||||||
|
&awscommon.StepCreateSSMTunnel{
|
||||||
|
AWSSession: session,
|
||||||
|
Region: *ec2conn.Config.Region,
|
||||||
|
RemotePortNumber: b.config.Comm.Port(),
|
||||||
|
SSMAgentEnabled: b.config.SSMAgentEnabled(),
|
||||||
|
},
|
||||||
&communicator.StepConnect{
|
&communicator.StepConnect{
|
||||||
Config: &b.config.RunConfig.Comm,
|
Config: &b.config.RunConfig.Comm,
|
||||||
Host: awscommon.SSHHost(
|
Host: awscommon.SSHHost(
|
||||||
|
@ -285,6 +292,14 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
||||||
b.config.SSHInterface,
|
b.config.SSHInterface,
|
||||||
b.config.Comm.Host(),
|
b.config.Comm.Host(),
|
||||||
),
|
),
|
||||||
|
SSHPort: awscommon.Port(
|
||||||
|
b.config.SSHInterface,
|
||||||
|
b.config.Comm.Port(),
|
||||||
|
),
|
||||||
|
WinRMPort: awscommon.Port(
|
||||||
|
b.config.SSHInterface,
|
||||||
|
b.config.Comm.Port(),
|
||||||
|
),
|
||||||
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&common.StepProvision{},
|
||||||
|
|
|
@ -238,6 +238,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
||||||
SecurityGroupIds: b.config.SecurityGroupIds,
|
SecurityGroupIds: b.config.SecurityGroupIds,
|
||||||
CommConfig: &b.config.RunConfig.Comm,
|
CommConfig: &b.config.RunConfig.Comm,
|
||||||
TemporarySGSourceCidrs: b.config.TemporarySGSourceCidrs,
|
TemporarySGSourceCidrs: b.config.TemporarySGSourceCidrs,
|
||||||
|
SkipSSHRuleCreation: b.config.SSMAgentEnabled(),
|
||||||
},
|
},
|
||||||
&awscommon.StepIamInstanceProfile{
|
&awscommon.StepIamInstanceProfile{
|
||||||
IamInstanceProfile: b.config.IamInstanceProfile,
|
IamInstanceProfile: b.config.IamInstanceProfile,
|
||||||
|
@ -255,6 +256,12 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
||||||
Timeout: b.config.WindowsPasswordTimeout,
|
Timeout: b.config.WindowsPasswordTimeout,
|
||||||
BuildName: b.config.PackerBuildName,
|
BuildName: b.config.PackerBuildName,
|
||||||
},
|
},
|
||||||
|
&awscommon.StepCreateSSMTunnel{
|
||||||
|
AWSSession: session,
|
||||||
|
Region: *ec2conn.Config.Region,
|
||||||
|
RemotePortNumber: b.config.Comm.Port(),
|
||||||
|
SSMAgentEnabled: b.config.SSMAgentEnabled(),
|
||||||
|
},
|
||||||
&communicator.StepConnect{
|
&communicator.StepConnect{
|
||||||
Config: &b.config.RunConfig.Comm,
|
Config: &b.config.RunConfig.Comm,
|
||||||
Host: awscommon.SSHHost(
|
Host: awscommon.SSHHost(
|
||||||
|
@ -262,6 +269,14 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
||||||
b.config.SSHInterface,
|
b.config.SSHInterface,
|
||||||
b.config.Comm.Host(),
|
b.config.Comm.Host(),
|
||||||
),
|
),
|
||||||
|
SSHPort: awscommon.Port(
|
||||||
|
b.config.SSHInterface,
|
||||||
|
b.config.Comm.Port(),
|
||||||
|
),
|
||||||
|
WinRMPort: awscommon.Port(
|
||||||
|
b.config.SSHInterface,
|
||||||
|
b.config.Comm.Port(),
|
||||||
|
),
|
||||||
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&common.StepProvision{},
|
||||||
|
|
|
@ -339,9 +339,10 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
||||||
BuildName: b.config.PackerBuildName,
|
BuildName: b.config.PackerBuildName,
|
||||||
},
|
},
|
||||||
&awscommon.StepCreateSSMTunnel{
|
&awscommon.StepCreateSSMTunnel{
|
||||||
AWSSession: session,
|
AWSSession: session,
|
||||||
DstPort: b.config.Comm.Port(),
|
Region: *ec2conn.Config.Region,
|
||||||
SSMAgentEnabled: b.config.SSMAgentEnabled(),
|
RemotePortNumber: b.config.Comm.Port(),
|
||||||
|
SSMAgentEnabled: b.config.SSMAgentEnabled(),
|
||||||
},
|
},
|
||||||
&communicator.StepConnect{
|
&communicator.StepConnect{
|
||||||
// StepConnect is provided settings for WinRM and SSH, but
|
// StepConnect is provided settings for WinRM and SSH, but
|
||||||
|
|
Loading…
Reference in New Issue