wire up netbox #993

Merged
kiara merged 4 commits from kiara/fediversity:setup-netbox into main 2026-05-23 21:49:17 +02:00
Owner

Wires up netbox into deployments, as part of #833.

Add a netbox arg to hosts-common.nix, tf-hosts.nix, and tf-incus-hosts.nix so callers can opt into NetBox IP management.
When non-null, hosts-common builds the four TF effects (tf-netbox-cluster-type, tf-netbox-cluster, tf-netbox-store-ips, tf-netbox-get-ip) and exposes them as config.netbox.seed.* and config.netbox.perApp.<app>.{allocate,release}.

default.nix reads NETBOX_CLUSTER_NAME, NETBOX_CLUSTER_TYPE_NAME, NETBOX_IP_RANGE_{START,END}, and NETBOX_TF_BACKEND to assemble the netboxArgs struct; NETBOX_SERVER_URL/NETBOX_API_TOKEN remain run-time-only (consumed by the OpenTofu provider, not Nix).

checks/apps/tf-incus/nixosTest.nix now consumes all.netbox.* from the flake-generated tf-incus-hosts output instead of building the four effects locally, removing the local evalOption block.

Assisted-by: Claude:claude-opus-4-7[1m]

Wires up netbox into deployments, as part of #833. Add a `netbox` arg to `hosts-common.nix`, `tf-hosts.nix`, and `tf-incus-hosts.nix` so callers can opt into NetBox IP management. When non-null, `hosts-common` builds the four TF effects (`tf-netbox-cluster-type`, `tf-netbox-cluster`, `tf-netbox-store-ips`, `tf-netbox-get-ip`) and exposes them as `config.netbox.seed.*` and `config.netbox.perApp.<app>.{allocate,release}`. `default.nix` reads `NETBOX_CLUSTER_NAME`, `NETBOX_CLUSTER_TYPE_NAME`, `NETBOX_IP_RANGE_{START,END}`, and `NETBOX_TF_BACKEND` to assemble the `netboxArgs` struct; `NETBOX_SERVER_URL`/`NETBOX_API_TOKEN` remain run-time-only (consumed by the OpenTofu provider, not Nix). `checks/apps/tf-incus/nixosTest.nix` now consumes `all.netbox.*` from the flake-generated `tf-incus-hosts` output instead of building the four effects locally, removing the local `evalOption` block. Assisted-by: Claude:claude-opus-4-7[1m]
kiara force-pushed setup-netbox from 71f1565161
Some checks failed
Nix flake completeness check / _complete (pull_request) Successful in 12s
checks-deployment-nixos-hosts / deployment-nixos-hosts (pull_request) Successful in 18s
checks-apps-tf-incus / apps-tf-incus (pull_request) Failing after 10m24s
checks-apps-tf / apps-tf (pull_request) Successful in 13m11s
checks-integrations-octodns / integrations-octodns (pull_request) Successful in 18s
checks-panel-basic / panel-basic (pull_request) Successful in 46s
checks-deployment-ssh-hosts / deployment-ssh-hosts (pull_request) Successful in 13m57s
checks-panel-migrations / panel-migrations (pull_request) Successful in 3s
checks-pre-commit / pre-commit (pull_request) Failing after 5s
checks-test-incus-service / test-incus-service (pull_request) Successful in 7s
checks-test-mastodon-service / test-mastodon-service (pull_request) Successful in 7s
checks-test-netbox-service / test-netbox-service (pull_request) Successful in 12s
checks-test-peertube-service / test-peertube-service (pull_request) Successful in 8s
checks-test-pixelfed-service / test-pixelfed-service (pull_request) Successful in 8s
devShells-default / default (pull_request) Successful in 6s
nix-unit-effects-common-lib / effects-common-lib (pull_request) Successful in 7s
nix-unit-effects-tf-common-conversion / effects-tf-common-conversion (pull_request) Successful in 7s
nix-unit-lib-data-model / lib-data-model (pull_request) Successful in 7s
nix-unit-lib-function / lib-function (pull_request) Successful in 7s
flake-show / apps-ssh (pull_request) Successful in 41s
nix-unit-lib-lib / lib-lib (pull_request) Successful in 7s
nixosConfigurations-dev-combined / dev-combined (pull_request) Successful in 2s
nixosConfigurations-dev-forgejo-runner / dev-forgejo-runner (pull_request) Successful in 2s
nixosConfigurations-dev-forgejo / dev-forgejo (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-combined / hosting-provider-combined (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-incus / hosting-provider-incus (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-netbox / hosting-provider-netbox (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-openbao / hosting-provider-openbao (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-panel / hosting-provider-panel (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-terraform-backend / hosting-provider-terraform-backend (pull_request) Successful in 2s
nixosConfigurations-operator-authelia / operator-authelia (pull_request) Successful in 2s
nixosConfigurations-operator-combined / operator-combined (pull_request) Successful in 2s
nixosConfigurations-operator-garage / operator-garage (pull_request) Successful in 2s
nixosConfigurations-operator-mastodon / operator-mastodon (pull_request) Successful in 2s
nixosConfigurations-operator-peertube / operator-peertube (pull_request) Successful in 2s
nixosConfigurations-operator-pixelfed / operator-pixelfed (pull_request) Successful in 2s
checks-deployment-tf-incus-hosts / deployment-tf-incus-hosts (pull_request) Successful in 11m35s
checks-deployment-tf-hosts / deployment-tf-hosts (pull_request) Successful in 16m55s
checks-apps-panel / apps-panel (pull_request) Successful in 27m38s
to 8d7d3da5d7
Some checks failed
Nix flake completeness check / _complete (pull_request) Successful in 11s
checks-deployment-nixos-hosts / deployment-nixos-hosts (pull_request) Successful in 18s
checks-apps-tf-incus / apps-tf-incus (pull_request) Failing after 9m53s
checks-integrations-octodns / integrations-octodns (pull_request) Successful in 18s
checks-panel-basic / panel-basic (pull_request) Successful in 49s
checks-panel-migrations / panel-migrations (pull_request) Successful in 3s
checks-pre-commit / pre-commit (pull_request) Successful in 5s
checks-test-incus-service / test-incus-service (pull_request) Successful in 6s
checks-test-mastodon-service / test-mastodon-service (pull_request) Successful in 7s
checks-test-netbox-service / test-netbox-service (pull_request) Successful in 11s
checks-test-peertube-service / test-peertube-service (pull_request) Successful in 8s
checks-test-pixelfed-service / test-pixelfed-service (pull_request) Successful in 7s
devShells-default / default (pull_request) Successful in 5s
checks-deployment-tf-incus-hosts / deployment-tf-incus-hosts (pull_request) Successful in 11m48s
nix-unit-effects-common-lib / effects-common-lib (pull_request) Successful in 7s
nix-unit-effects-tf-common-conversion / effects-tf-common-conversion (pull_request) Successful in 7s
nix-unit-lib-data-model / lib-data-model (pull_request) Successful in 7s
nix-unit-lib-function / lib-function (pull_request) Successful in 7s
flake-show / apps-ssh (pull_request) Successful in 35s
nixosConfigurations-dev-combined / dev-combined (pull_request) Successful in 1s
nix-unit-lib-lib / lib-lib (pull_request) Successful in 7s
nixosConfigurations-dev-forgejo-runner / dev-forgejo-runner (pull_request) Successful in 1s
nixosConfigurations-dev-forgejo / dev-forgejo (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-combined / hosting-provider-combined (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-incus / hosting-provider-incus (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-netbox / hosting-provider-netbox (pull_request) Successful in 1s
nixosConfigurations-hosting-provider-openbao / hosting-provider-openbao (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-panel / hosting-provider-panel (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-terraform-backend / hosting-provider-terraform-backend (pull_request) Successful in 2s
nixosConfigurations-operator-authelia / operator-authelia (pull_request) Successful in 1s
nixosConfigurations-operator-combined / operator-combined (pull_request) Successful in 2s
nixosConfigurations-operator-garage / operator-garage (pull_request) Successful in 1s
nixosConfigurations-operator-mastodon / operator-mastodon (pull_request) Successful in 2s
nixosConfigurations-operator-peertube / operator-peertube (pull_request) Successful in 2s
nixosConfigurations-operator-pixelfed / operator-pixelfed (pull_request) Successful in 2s
checks-deployment-ssh-hosts / deployment-ssh-hosts (pull_request) Successful in 14m3s
checks-deployment-tf-hosts / deployment-tf-hosts (pull_request) Successful in 16m41s
checks-apps-panel / apps-panel (pull_request) Successful in 27m24s
checks-apps-tf / apps-tf (pull_request) Successful in 29m41s
2026-05-23 16:56:08 +02:00
Compare
fix tf address
Some checks failed
Nix flake completeness check / _complete (pull_request) Successful in 11s
checks-deployment-nixos-hosts / deployment-nixos-hosts (pull_request) Successful in 17s
checks-apps-tf / apps-tf (pull_request) Successful in 13m3s
checks-deployment-ssh-hosts / deployment-ssh-hosts (pull_request) Successful in 13m54s
checks-integrations-octodns / integrations-octodns (pull_request) Successful in 41s
checks-panel-basic / panel-basic (pull_request) Successful in 2m11s
checks-panel-migrations / panel-migrations (pull_request) Successful in 7s
checks-pre-commit / pre-commit (pull_request) Successful in 11s
checks-test-incus-service / test-incus-service (pull_request) Successful in 14s
checks-test-mastodon-service / test-mastodon-service (pull_request) Successful in 20s
checks-deployment-tf-incus-hosts / deployment-tf-incus-hosts (pull_request) Successful in 11m34s
checks-test-peertube-service / test-peertube-service (pull_request) Successful in 8s
checks-test-pixelfed-service / test-pixelfed-service (pull_request) Successful in 8s
devShells-default / default (pull_request) Successful in 6s
checks-apps-panel / apps-panel (pull_request) Successful in 27m26s
nix-unit-effects-common-lib / effects-common-lib (pull_request) Successful in 7s
nix-unit-effects-tf-common-conversion / effects-tf-common-conversion (pull_request) Successful in 7s
nix-unit-lib-data-model / lib-data-model (pull_request) Successful in 3s
nix-unit-lib-function / lib-function (pull_request) Successful in 3s
nix-unit-lib-lib / lib-lib (pull_request) Successful in 3s
nixosConfigurations-dev-combined / dev-combined (pull_request) Successful in 2s
flake-show / apps-ssh (pull_request) Successful in 37s
nixosConfigurations-dev-forgejo-runner / dev-forgejo-runner (pull_request) Successful in 2s
nixosConfigurations-dev-forgejo / dev-forgejo (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-combined / hosting-provider-combined (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-incus / hosting-provider-incus (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-netbox / hosting-provider-netbox (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-openbao / hosting-provider-openbao (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-panel / hosting-provider-panel (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-terraform-backend / hosting-provider-terraform-backend (pull_request) Successful in 2s
nixosConfigurations-operator-authelia / operator-authelia (pull_request) Successful in 2s
nixosConfigurations-operator-combined / operator-combined (pull_request) Successful in 2s
nixosConfigurations-operator-garage / operator-garage (pull_request) Successful in 2s
nixosConfigurations-operator-mastodon / operator-mastodon (pull_request) Successful in 2s
nixosConfigurations-operator-peertube / operator-peertube (pull_request) Successful in 2s
nixosConfigurations-operator-pixelfed / operator-pixelfed (pull_request) Successful in 2s
checks-deployment-tf-hosts / deployment-tf-hosts (pull_request) Successful in 16m17s
checks-test-netbox-service / test-netbox-service (pull_request) Successful in 9m45s
checks-apps-tf-incus / apps-tf-incus (pull_request) Failing after 1h4m17s
84ea1d7c4c
Signed-off-by: Kiara Grouwstra <kiara@procolix.eu>
hosts-common: idempotent NetBox seed + JSON-preserving composite
All checks were successful
Nix flake completeness check / _complete (pull_request) Successful in 11s
checks-deployment-nixos-hosts / deployment-nixos-hosts (pull_request) Successful in 18s
checks-apps-tf / apps-tf (pull_request) Successful in 13m7s
checks-integrations-octodns / integrations-octodns (pull_request) Successful in 19s
checks-panel-basic / panel-basic (pull_request) Successful in 48s
checks-panel-migrations / panel-migrations (pull_request) Successful in 3s
checks-pre-commit / pre-commit (pull_request) Successful in 5s
checks-test-incus-service / test-incus-service (pull_request) Successful in 6s
checks-deployment-ssh-hosts / deployment-ssh-hosts (pull_request) Successful in 14m16s
checks-test-mastodon-service / test-mastodon-service (pull_request) Successful in 8s
checks-test-netbox-service / test-netbox-service (pull_request) Successful in 12s
checks-test-peertube-service / test-peertube-service (pull_request) Successful in 8s
checks-apps-tf-incus / apps-tf-incus (pull_request) Successful in 15m3s
checks-test-pixelfed-service / test-pixelfed-service (pull_request) Successful in 8s
devShells-default / default (pull_request) Successful in 5s
nix-unit-effects-common-lib / effects-common-lib (pull_request) Successful in 7s
nix-unit-effects-tf-common-conversion / effects-tf-common-conversion (pull_request) Successful in 7s
nix-unit-lib-data-model / lib-data-model (pull_request) Successful in 7s
nix-unit-lib-function / lib-function (pull_request) Successful in 7s
nixosConfigurations-dev-combined / dev-combined (pull_request) Successful in 2s
nix-unit-lib-lib / lib-lib (pull_request) Successful in 7s
nixosConfigurations-dev-forgejo-runner / dev-forgejo-runner (pull_request) Successful in 2s
nixosConfigurations-dev-forgejo / dev-forgejo (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-combined / hosting-provider-combined (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-incus / hosting-provider-incus (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-netbox / hosting-provider-netbox (pull_request) Successful in 2s
flake-show / apps-ssh (pull_request) Successful in 37s
nixosConfigurations-hosting-provider-openbao / hosting-provider-openbao (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-panel / hosting-provider-panel (pull_request) Successful in 2s
nixosConfigurations-hosting-provider-terraform-backend / hosting-provider-terraform-backend (pull_request) Successful in 2s
nixosConfigurations-operator-authelia / operator-authelia (pull_request) Successful in 2s
nixosConfigurations-operator-combined / operator-combined (pull_request) Successful in 2s
nixosConfigurations-operator-garage / operator-garage (pull_request) Successful in 2s
nixosConfigurations-operator-mastodon / operator-mastodon (pull_request) Successful in 2s
nixosConfigurations-operator-peertube / operator-peertube (pull_request) Successful in 2s
nixosConfigurations-operator-pixelfed / operator-pixelfed (pull_request) Successful in 2s
checks-deployment-tf-hosts / deployment-tf-hosts (pull_request) Successful in 16m30s
checks-apps-panel / apps-panel (pull_request) Successful in 27m6s
checks-deployment-tf-incus-hosts / deployment-tf-incus-hosts (pull_request) Successful in 34m23s
b3253e5152
Gate seed/`allocate`/`release` on `NETBOX_SERVER_URL`+`NETBOX_API_TOKEN`
so re-invocations without NetBox credentials are a no-op for those steps.
Capture each sub-step's `tofu output -json` and merge with `jq -s`, with
the main app `run` last so its outputs win on key conflicts. Stdout of
the composite is now a single valid JSON object.

Assisted-by: Claude:claude-sonnet-4-6[1m]
kiara changed title from WIP: wire up netbox to wire up netbox 2026-05-23 21:47:50 +02:00
kiara merged commit a470a4847c into main 2026-05-23 21:49:17 +02:00
kiara referenced this pull request from a commit 2026-05-23 21:49:19 +02:00
Sign in to join this conversation.
No reviewers
fediversity/developers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
fediversity/fediversity!993
No description provided.