You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using this plugin, to provision a machine on DO.
My public ssh key was already part of my DO account.
if I do not set the provider.ssh_key_name in the Vagrantfile I get the following error:
$ vagrant up --provider=digital_ocean
Bringing machine 'default' up with 'digital_ocean' provider...
==> default: Creating new SSH key: Vagrant...
There was an issue with the request made to the DigitalOcean
API at:
Path: /v2/account/keys
URI Params: {:name=>"Vagrant", :public_key=>"[snip]"}
The response status from the API was:
Status: 422
Response: {"id"=>"unprocessable_entity", "message"=>"SSH Key is already in use on your account"}
If I set the provider.ssh_key_name to the key names then everything works. The key name can be obtained using the command tugboatkeys.
Please note that I have chosen as provider.ssh_key_namethe name of the same key that I have indicated in override.ssh.private_key_path (i.e. '~/.ssh/id_rsa' is the private key corresponding to the $DIGITALOCEAN_SSH_KEY_NAME public key in my DO accout).
Here is the example Vagrantfile with some slight modification to fix this problem, I am using environment variables to store my private data:
Vagrant.configure('2')do |config|
config.vm.hostname='dropletname.example.com'# Alternatively, use provider.name below to set the Droplet name. config.vm.hostname takes precedence.config.vm.provider:digital_oceando |provider,override|
# This is akways needed but if the key is already used in the DO account# you *need* to set the provider.ssh_key_name parameter.override.ssh.private_key_path='~/.ssh/id_rsa'override.vm.box='digital_ocean'override.vm.box_url="https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box"provider.token=ENV['DIGITALOCEAN_TOKEN']provider.ssh_key_name=ENV['DIGITALOCEAN_SSH_KEY_NAME']provider.image='ubuntu-14-04-x64'provider.region='nyc2'provider.size='512mb'endend
I think that the documentation is unclear as of now, and this error could cause confusion.
Thank you for this great plugin.
The text was updated successfully, but these errors were encountered:
CristianCantoro
changed the title
[documentation] Clarify the role of override.ssh.private_key_path and provider.ssh_key_name
[documentation] Clarify the role of override.ssh.private_key_path vs provider.ssh_key_name
Jan 4, 2016
Thank you for your feedback - by default everything works as expected. We feel this would cause more confusion as we currently note that by default, the key name is Vagrant.
provider.ssh_key_name
A string representing the name to use when creating a DigitalOcean SSH key for droplet authentication. It defaults to Vagrant.
Hi,
I am using this plugin, to provision a machine on DO.
My public ssh key was already part of my DO account.
if I do not set the
provider.ssh_key_name
in the Vagrantfile I get the following error:If I set the
provider.ssh_key_name
to the key names then everything works. The key name can be obtained using the commandtugboat
keys
.Please note that I have chosen as
provider.ssh_key_name
the name of the same key that I have indicated inoverride.ssh.private_key_path
(i.e.'~/.ssh/id_rsa'
is the private key corresponding to the$DIGITALOCEAN_SSH_KEY_NAME
public key in my DO accout).Here is the example Vagrantfile with some slight modification to fix this problem, I am using environment variables to store my private data:
I think that the documentation is unclear as of now, and this error could cause confusion.
Thank you for this great plugin.
The text was updated successfully, but these errors were encountered: