Skip to content

Use keypair from StepSSHKeyGen instead of Nova-generated keys#60

Merged
nywilken merged 1 commit intohashicorp:mainfrom
Azzore:fix/use-step-ssh-keygen-instead-of-nova-generated-keys
May 5, 2022
Merged

Use keypair from StepSSHKeyGen instead of Nova-generated keys#60
nywilken merged 1 commit intohashicorp:mainfrom
Azzore:fix/use-step-ssh-keygen-instead-of-nova-generated-keys

Conversation

@Azzore
Copy link
Copy Markdown
Contributor

@Azzore Azzore commented May 1, 2022

Closes #54

Since openstack's nova api can only generates RSA Keys, but let us upload other algorithms such as ed25519.

Closes hashicorp#54

Since openstack's nova api can only generates RSA Keys, but let us
upload other algorithms such as ed25519
@Azzore Azzore requested a review from a team as a code owner May 1, 2022 14:44
@hashicorp-cla
Copy link
Copy Markdown

hashicorp-cla commented May 1, 2022

CLA assistant check
All committers have signed the CLA.

Comment on lines -125 to -126
// Work around for https://github.com/hashicorp/packer/issues/2526
func berToDer(ber []byte, ui packersdk.Ui) []byte {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the linked issue on why this was added and seeing that the Openstack API is not the one creating the SSH key this workaround is no longer necessary, correct?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, since openstack api can only generate ssh-rsa keys or x509. The go api let us push already existing keypairs https://github.com/gophercloud/gophercloud/blob/master/openstack/compute/v2/extensions/keypairs/requests.go#L89
The api doesn't even return content of the uploaded key then we do not parse openstack keys anymore

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great thanks for the quick response.

Copy link
Copy Markdown
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me. I have a question about the deleted code that I would like for you to confirm before we merge. That said, we will bump the minor version for the next release to denote there is a change that folks should look into before using the latest version.

@nywilken
Copy link
Copy Markdown
Contributor

nywilken commented May 5, 2022

This documentation needs to be updated but that can be done in a separate PR.

~> OpenStack Liberty or later requires OpenSSL! To use the OpenStack builder with OpenStack Liberty (Oct 2015) or later you need to have OpenSSL installed if you are using temporary key pairs, i.e. don't use [ssh_keypair_name](https://github.com/hashicorp/packer-plugin-openstack/blob/main/docs/builders/openstack.mdx#ssh_keypair_name) nor [ssh_password](https://github.com/hashicorp/packer-plugin-openstack/blob/main/docs/builders/openstack.mdx#ssh_password). All major OS'es have OpenSSL installed by default except Windows. This have been resolved in OpenStack Ocata(Feb 2017).```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

temporary_key_pair_type is ignored, RSA is always used

3 participants