mirror of
https://github.com/nix-community/nixos-anywhere.git
synced 2024-10-05 20:27:20 +03:00
terraform: add instance_id to trigger reinstall
This commit is contained in:
parent
ed0ab16c58
commit
29b0f1b5f2
@ -20,6 +20,7 @@ module "install" {
|
||||
nixos_system = module.system-build.result.out
|
||||
ssh_private_key = var.ssh_private_key
|
||||
debug_logging = var.debug_logging
|
||||
instance_id = var.instance_id
|
||||
}
|
||||
|
||||
module "nixos-rebuild" {
|
||||
|
@ -39,6 +39,12 @@ variable "target_port" {
|
||||
default = 22
|
||||
}
|
||||
|
||||
variable "instance_id" {
|
||||
type = string
|
||||
description = "The instance id of the target_host, used to track when to reinstall the machine"
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "ssh_private_key" {
|
||||
type = string
|
||||
description = "Content of private key used to connect to the target_host"
|
||||
|
@ -1,8 +1,11 @@
|
||||
locals {
|
||||
nixos_anywhere_flags = "${var.debug_logging ? "--debug" : ""} ${var.kexec_tarball_url != "" ? "--kexec ${var.kexec_tarball_url}" : "" } --store-paths ${var.nixos_partitioner} ${var.nixos_system} ${var.target_user}@${var.target_host}"
|
||||
nixos_anywhere_flags = "${var.debug_logging ? "--debug" : ""} ${var.kexec_tarball_url != null ? "--kexec ${var.kexec_tarball_url}" : "" } --store-paths ${var.nixos_partitioner} ${var.nixos_system} ${var.target_user}@${var.target_host}"
|
||||
}
|
||||
|
||||
resource "null_resource" "nixos-remote" {
|
||||
triggers = {
|
||||
instance_id = var.instance_id
|
||||
}
|
||||
provisioner "local-exec" {
|
||||
environment = {
|
||||
SSH_PRIVATE_KEY = var.ssh_private_key
|
||||
|
@ -39,6 +39,12 @@ variable "ssh_private_key" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "instance_id" {
|
||||
type = string
|
||||
description = "The instance id of the target_host, used to track when to reinstall the machine"
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "debug_logging" {
|
||||
type = bool
|
||||
description = "Enable debug logging"
|
||||
|
Loading…
Reference in New Issue
Block a user