hashicorp / terraform-provider-oneandone

Terraform 1&1 provider. Please note: This Terraform provider is archived per our provider archiving process: https://terraform.io/docs/internals/archiving.html
https://www.terraform.io/docs/providers/oneandone/
Mozilla Public License 2.0
5 stars 11 forks source link

server: allow to pre-depoly a ssh-public-key #6

Closed ekle closed 7 years ago

ekle commented 7 years ago

this allows to pre-deploy a ssh-public-key to a server without the requirement to have the private key within terraform.

@jasminSPC should i also create an issue for this ?

jasmingacic commented 7 years ago

@ekle does this eliminate the need for ssh_key_path? Also can you elaborate the need for this? P.s. no need to open an issue

ekle commented 7 years ago

@jasmingacic ssh_key_path is not required anymore. (we could set it to Deprecated?) the provisioner "remote-exec" will still work out of the box by using the instance password instead of the private key to ssh into the server.

with this change we can for example use the resource "tls_private_key" to dynamically create and use a ssh-key within terraform, without the need to save it to a file.

jasmingacic commented 7 years ago

@ekle Not using ssh key in provisioner is not an option since user might only have ssh key and no password.

ekle commented 7 years ago

@jasmingacic not sure it is possible to create a server without password. at the moment the password is autogenerated if i don't provide one or if i provide a empty one.

the user has still the option to provide a private-key to the provisioner if he wants to auth with it.

jasmingacic commented 7 years ago

Yes the password is autogenerated but if you didn't provide it, you don't have to use it.

jasmingacic commented 7 years ago

@ekle ping

ekle commented 7 years ago

from my side this is finishend, except if we want to mark the old ssh_key_path as deprecate in favor of the new more flexible way.

jasmingacic commented 7 years ago

@ekle Thanks, I merged it and it is going to be released with 0.1.1 of the plugin.