clan-infra/terraform/web01/main.tf

33 lines
682 B
Terraform
Raw Normal View History

locals {
2023-07-04 14:43:31 +00:00
}
resource "null_resource" "nixos-anywhere" {
triggers = {
instance_id = var.ipv4_address
}
connection {
type = "ssh"
user = "root"
host = var.ipv4_address
}
provisioner "remote-exec" {
# needed because kexec is broken
# https://github.com/numtide/nixos-anywhere/issues/136
script = "${path.module}/nixosify.sh"
}
provisioner "local-exec" {
environment = {
HOST = var.ipv4_address
FLAKE_ATTR = var.nixos_flake_attr
SOPS_SECRETS_FILE = var.sops_secrets_file
}
command = "bash -x ${path.module}/install.sh"
2023-07-04 14:43:31 +00:00
}
}
locals {
nixos_vars = {
ipv6_address = var.ipv6_address
2023-07-04 14:43:31 +00:00
}
}