Skip to content

Commit dad3cde

Browse files
bors[bot]jfroche
andauthored
Merge #128
128: terraform: do not show private key in local-exec logs r=zimbatm a=jfroche Co-authored-by: Jean-François Roche <[email protected]>
2 parents 8d16137 + 8ba2cbf commit dad3cde

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

terraform/install/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ resource "null_resource" "nixos-remote" {
1111
SSH_PRIVATE_KEY = var.ssh_private_key
1212
}
1313
command = "nix run --extra-experimental-features 'nix-command flakes' path:${path.module}/../..#nixos-anywhere -- ${local.nixos_anywhere_flags}"
14+
quiet = var.debug_logging
1415
}
1516
}

terraform/nixos-rebuild/deploy.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ sshOpts=(-p "${TARGET_PORT}")
2323
sshOpts+=(-o UserKnownHostsFile=/dev/null)
2424
sshOpts+=(-o StrictHostKeyChecking=no)
2525

26+
set +x
2627
if [[ -n ${SSH_KEY+x} && ${SSH_KEY} != "-" ]]; then
2728
sshPrivateKeyFile="$workDir/ssh_key"
2829
# Create the file with 0700 - umask calculation: 777 - 700 = 077
@@ -33,6 +34,7 @@ if [[ -n ${SSH_KEY+x} && ${SSH_KEY} != "-" ]]; then
3334
unset SSH_AUTH_SOCK # don't use system agent if key was supplied
3435
sshOpts+=(-o "IdentityFile=${sshPrivateKeyFile}")
3536
fi
37+
set -x
3638

3739
try=1
3840
until NIX_SSHOPTS="${sshOpts[*]}" nix copy -s --experimental-features nix-command --to "ssh://$TARGET" "$NIXOS_SYSTEM"; do

0 commit comments

Comments
 (0)