nix-community / nixos-anywhere

install nixos everywhere via ssh [maintainer=@numtide]
https://nix-community.github.io/nixos-anywhere/
MIT License
1.53k stars 106 forks source link

Terraform: install module fails because stop_after_disko variable is not set #389

Closed max-pfeiffer closed 1 week ago

max-pfeiffer commented 2 weeks ago

How to reproduce (main.tf):

module "install" {
        source            = "github.com/nix-community/nixos-anywhere//terraform/install"
        depends_on = [proxmox_vm_qemu.opentofu-test]
        flake = local.flake_file
        build_on_remote = true
        target_host       = "192.168.1.11"
        ssh_private_key = file(local.private_key)
}

Running tofu apply fails with the following error:

│ Error: local-exec provisioner error
│ 
│   with module.install.null_resource.nixos-remote,
│   on .terraform/modules/install/terraform/install/main.tf line 26, in resource "null_resource" "nixos-remote":
│   26:   provisioner "local-exec" {
│ 
│ Error running command '.terraform/modules/install/terraform/install/run-nixos-anywhere.sh ': exit status 1. Output: .terraform/modules/install/terraform/install/run-nixos-anywhere.sh: line 19: input[stop_after_disko]: unbound variable
│ 
╵
Mic92 commented 1 week ago

Fixed in https://github.com/nix-community/nixos-anywhere/pull/391