76: nixos-rebuild: allow to change deploy user r=Lassulus a=Mic92



Co-authored-by: Jörg Thalheim <joerg@thalheim.io>
This commit is contained in:
bors[bot] 2023-03-04 13:33:08 +00:00 committed by GitHub
commit b7e335a5f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -10,10 +10,14 @@ module "partitioner-build" {
file = var.file
}
locals {
install_user = var.install_user == null ? var.target_user : var.install_user
}
module "install" {
source = "../install"
kexec_tarball_url = var.kexec_tarball_url
target_user = var.target_user
target_user = local.install_user
target_host = var.target_host
target_port = var.target_port
nixos_partitioner = module.partitioner-build.result.out
@ -30,4 +34,5 @@ module "nixos-rebuild" {
source = "../nixos-rebuild"
nixos_system = module.system-build.result.out
target_host = var.target_host
target_user = var.target_user
}

View File

@ -27,9 +27,15 @@ variable "target_host" {
description = "DNS host to deploy to"
}
variable "install_user" {
type = string
description = "SSH user used to connect to the target_host, before installing NixOS. If null than the value of `target_host` is used"
default = null
}
variable "target_user" {
type = string
description = "SSH user used to connect to the target_host, before installing NixOS"
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."
default = "root"
}