-
-
Notifications
You must be signed in to change notification settings - Fork 63
Pass SSH private key using env var #71
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -194,14 +194,16 @@ resource "null_resource" "deploy_nixos" { | |
data.external.nixos-instantiate.result["out_path"], | ||
"${var.target_user}@${var.target_host}", | ||
var.target_port, | ||
local.build_on_target, | ||
local.ssh_private_key == "" ? "-" : local.ssh_private_key, | ||
"switch", | ||
var.delete_older_than, | ||
], | ||
local.extra_build_args | ||
) | ||
command = "ignoreme" | ||
environment = { | ||
BUILD_ON_TARGET = local.build_on_target | ||
SSH_PRIVATE_KEY = local.ssh_private_key == "" ? "-" : local.ssh_private_key | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While this will hide the key itself from output, a variable still marked as sensitive will cause the output to be suppressed. Might be worth wrapping this in nonsensitive() although that would require bumping the minimum required terraform version from 0.12 to 0.15. Also there should be nothing stopping callers from wrapping the key in |
||
} | ||
} | ||
} | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.
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.
Making the
ssh_private_key
a environmnet variable makes sense to me to avoid sensitive data in the output, but why isbuild_on_target
also being moved to an env var? I don't think there's necessary any reason it shouldn't be an env var, but I also see no reason to move it.