Skip to content

Commit b7e335a

Browse files
bors[bot]Mic92
andauthored
Merge #76
76: nixos-rebuild: allow to change deploy user r=Lassulus a=Mic92 Co-authored-by: Jörg Thalheim <joerg@thalheim.io>
2 parents 6d0e923 + 48fe2fa commit b7e335a

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

terraform/all-in-one/main.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ module "partitioner-build" {
1010
file = var.file
1111
}
1212

13+
locals {
14+
install_user = var.install_user == null ? var.target_user : var.install_user
15+
}
16+
1317
module "install" {
1418
source = "../install"
1519
kexec_tarball_url = var.kexec_tarball_url
16-
target_user = var.target_user
20+
target_user = local.install_user
1721
target_host = var.target_host
1822
target_port = var.target_port
1923
nixos_partitioner = module.partitioner-build.result.out
@@ -30,4 +34,5 @@ module "nixos-rebuild" {
3034
source = "../nixos-rebuild"
3135
nixos_system = module.system-build.result.out
3236
target_host = var.target_host
37+
target_user = var.target_user
3338
}

terraform/all-in-one/variables.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,15 @@ variable "target_host" {
2727
description = "DNS host to deploy to"
2828
}
2929

30+
variable "install_user" {
31+
type = string
32+
description = "SSH user used to connect to the target_host, before installing NixOS. If null than the value of `target_host` is used"
33+
default = null
34+
}
35+
3036
variable "target_user" {
3137
type = string
32-
description = "SSH user used to connect to the target_host, before installing NixOS"
38+
description = "SSH user used to connect to the target_host after installing NixOS. If install_user is not set than this user is also used before installing."
3339
default = "root"
3440
}
3541

0 commit comments

Comments
 (0)