Skip to content

Commit 0174074

Browse files
Exeteresmergify[bot]
authored andcommitted
Add ability to specify password on install
1 parent 8279ad8 commit 0174074

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

terraform/install/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ resource "null_resource" "nixos-remote" {
99
provisioner "local-exec" {
1010
environment = merge({
1111
SSH_PRIVATE_KEY = var.ssh_private_key
12+
SSH_PASS = var.target_pass
1213
stop_after_disko = var.stop_after_disko
1314
debug_logging = var.debug_logging
1415
kexec_tarball_url = var.kexec_tarball_url

terraform/install/run-nixos-anywhere.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ if [[ -n ${flake-} ]]; then
2525
else
2626
args+=("--store-paths" "${nixos_partitioner}" "${nixos_system}")
2727
fi
28+
if [[ ${SSH_PASS} ]]; then
29+
args+=("--env-password")
30+
fi
2831

2932
tmpdir=$(mktemp -d)
3033
cleanup() {

terraform/install/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ variable "target_port" {
3535
default = 22
3636
}
3737

38+
variable "target_pass" {
39+
type = string
40+
description = "Password used to connect to the target_host"
41+
default = null
42+
}
43+
3844
variable "ssh_private_key" {
3945
type = string
4046
description = "Content of private key used to connect to the target_host"

0 commit comments

Comments
 (0)