only set role name if it's set.

This commit is contained in:
Matthew Hooker 2018-01-25 10:37:34 -08:00
parent 00a55e209a
commit 48e12b6bee
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1
1 changed files with 4 additions and 5 deletions

View File

@ -64,10 +64,6 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
p.config.S3Key = "packer-import-{{timestamp}}.ova"
}
if p.config.RoleName == "" {
p.config.RoleName = "vmimport"
}
errs := new(packer.MultiError)
// Check and render s3_key_name
@ -169,7 +165,10 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac
},
},
},
RoleName: &p.config.RoleName,
}
if p.config.RoleName != "" {
params.SetRoleName(p.config.RoleName)
}
if p.config.LicenseType != "" {