provisioner/ansible: Fix dropped error

This commit is contained in:
Lars Lehtonen 2019-08-27 16:52:52 -07:00
parent 04d9888657
commit b207752883
1 changed files with 4 additions and 0 deletions

View File

@ -240,6 +240,10 @@ func (p *Provisioner) Provision(ctx context.Context, ui packer.Ui, comm packer.C
}
hostSigner, err := newSigner(p.config.SSHHostKeyFile)
if err != nil {
return fmt.Errorf("error creating host signer: %s", err)
}
// Remove the private key file
if len(k.privKeyFile) > 0 {
defer os.Remove(k.privKeyFile)