Skip to content

Parameterize remote ssh connection timeout #66

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions deploy_nixos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ see also:
| target\_port | SSH port used to connect to the target\_host | `number` | `22` | no |
| target\_system | Nix system string | `string` | `"x86_64-linux"` | no |
| target\_user | SSH user used to connect to the target\_host | `string` | `"root"` | no |
| timeout | Remote ssh connection timeout | `string` | `"100s"` | no |
| triggers | Triggers for deploy | `map(string)` | `{}` | no |

## Outputs
Expand Down
8 changes: 7 additions & 1 deletion deploy_nixos/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ variable "delete_older_than" {
default = "+1"
}

variable "timeout" {
type = string
description = "Remote ssh connection timeout."
default = "100s"
}

# --------------------------------------------------------------------------

locals {
Expand Down Expand Up @@ -157,7 +163,7 @@ resource "null_resource" "deploy_nixos" {
port = var.target_port
user = var.target_user
agent = local.ssh_agent
timeout = "100s"
timeout = var.timeout
private_key = local.ssh_private_key == "-" ? "" : local.ssh_private_key
}

Expand Down