Skip to content

Commit

Permalink
⭐️ support ssh agent authentication (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-rock authored Jan 31, 2024
1 parent 1accc80 commit d81fee6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions provisioner/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,12 @@ func (p *Provisioner) executeCnspec(ui packer.Ui, comm packer.Communicator) erro
} else if len(p.buildInfo.SSHPrivateKey) > 0 {
cred := vault.NewPrivateKeyCredential(p.buildInfo.User, []byte(p.buildInfo.SSHPrivateKey), "")
assetConfig.Credentials = append(assetConfig.Credentials, cred)
} else if p.buildInfo.SSHAgentAuth {
cred := &vault.Credential{
Type: vault.CredentialType_ssh_agent,
User: p.buildInfo.User,
}
assetConfig.Credentials = append(assetConfig.Credentials, cred)
} else {
// fallback to password auth
cred := vault.NewPasswordCredential(p.buildInfo.User, p.buildInfo.Password)
Expand Down

0 comments on commit d81fee6

Please sign in to comment.