mirror of
https://github.com/nix-community/nixos-anywhere.git
synced 2024-09-11 16:45:28 +03:00
`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>
13 lines
312 B
HCL
13 lines
312 B
HCL
resource "null_resource" "nixos-rebuild" {
|
|
triggers = {
|
|
store_path = var.nixos_system
|
|
}
|
|
provisioner "local-exec" {
|
|
environment = {
|
|
SSH_KEY = var.ssh_private_key
|
|
}
|
|
|
|
command = "${path.module}/deploy.sh ${var.nixos_system} ${var.target_user}@${var.target_host} ${var.target_port}"
|
|
}
|
|
}
|