-
-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
terraform: allow nixos-rebuild to use specified private key for deployment #78
Conversation
620ef74
to
67a9470
Compare
…yment `nixos-rebuild/deploy.sh` script enable ssh authentication with a given private key through the `SSH_KEY` environment variable. Add additional variable for the private key used for the deployment. To encourage the use of ssh-agent and discourage the storage of deployment keys in the terraform state we do not set the install ssh key as the default for the deployment key. Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
6dffcac
to
16143cd
Compare
variable "ssh_private_key" { | ||
type = string | ||
description = "Content of private key used to connect to the target_host. If set to - no key is passed to openssh and ssh will back to its own configuration" | ||
default = "-" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why the dash is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because the check is explicitly for "-" in here: https://github.com/numtide/nixos-anywhere/blob/main/terraform/nixos-rebuild/deploy.sh#L22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the "-"
check for though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because not setting the value is more complicated in terraform than setting a dummy value which basically means: "no value"
Have just run this with |
bors merge |
nixos-rebuild/deploy.sh
script enable ssh authentication with a given private key through theSSH_KEY
environment variable.Add additional variable for the private key used for the deployment.
To encourage the use of ssh-agent and discourage the storage of deployment keys in the terraform state we do not set the install ssh key as the default for the deployment key.