forked from fediversity/fediversity
Compare commits
2 commits
6a4eb90658
...
6a105c2fce
| Author | SHA1 | Date | |
|---|---|---|---|
| 6a105c2fce | |||
| c91361e7d5 |
1 changed files with 14 additions and 7 deletions
|
|
@ -76,7 +76,7 @@ locals {
|
|||
}
|
||||
peertube = {
|
||||
cfg = var.peertube
|
||||
hostname = "test03"
|
||||
hostname = "test05"
|
||||
}
|
||||
}
|
||||
peripherals = { for name, inst in local.peripheral_configs : name => {
|
||||
|
|
@ -98,19 +98,26 @@ data "external" "hash" {
|
|||
program = ["echo", "{\"hash\":\"$(nix-hash ..)\"}"]
|
||||
}
|
||||
|
||||
# merge instantiate/deploy, cuz i don't want 24+s instantiates when nothing changed.
|
||||
# merged instantiate/deploy to prevent 24+s instantiates when nothing changed.
|
||||
# terraform-nixos separates these to only deploy if instantiate changed.
|
||||
# FIXME find a better solution for this. current considerations were:
|
||||
# - `resource null_resource` cannot have outputs, while we want info from the instantiation (unless built on host?).
|
||||
# - `data external` always runs, which is undesirable for steps like deploy/instantiation.
|
||||
# FIXME null_resource docs recommend terraform_data over null_resource
|
||||
resource "null_resource" "deploy_nixos" {
|
||||
# - generic resources cannot have outputs, while we want info from the instantiation (unless built on host?).
|
||||
# - `data` always runs, which is slow for deploy/instantiation.
|
||||
resource "terraform_data" "nixos" {
|
||||
for_each = {for name, inst in merge(
|
||||
local.peripherals,
|
||||
local.applications,
|
||||
) : name => inst if inst.cfg.enable}
|
||||
|
||||
triggers = data.external.hash.result
|
||||
triggers_replace = [
|
||||
data.external.hash.result,
|
||||
var.deploy_environment,
|
||||
var.domain,
|
||||
var.initialUser,
|
||||
local.system,
|
||||
each.key,
|
||||
each.value,
|
||||
]
|
||||
|
||||
provisioner "local-exec" {
|
||||
working_dir = path.root
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue