Skip to content

feat(tailnet): gc, rename and inventory alignment (scripts/tailnet.py) - #333

Closed
hanthor wants to merge 1 commit into
feat/chezmoi-file-rolesfrom
feat/tailnet-hygiene
Closed

hanthor wants to merge 1 commit into
feat/chezmoi-file-rolesfrom
feat/tailnet-hygiene

Conversation

@hanthor

@hanthor hanthor commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Stacked on #332.

Why

The tailnet has 54 devices (2 online): duplicates (himachal/himachal-1, kerala/kerala-1), six dead gate-*/repro-* test VMs, and inventory.yml pointing at stale addresses (himachal 100.73.3.51). Root cause of the -1 names: the tailscale role's pre-join cleanup used the OAuth client secret as a classic API key; Tailscale answers 401, failed_when: false hid it, and nothing was ever deleted. The secret in Bitwarden (tailscale-apikey) is itself rejected by Tailscale today (token exchange returns 401), so a new OAuth client is needed.

What

  • scripts/tailnet.py audit / gc / rename / fix-inventory / sync / release; dry run unless --apply; reads fall back to local tailscale status.
  • just tailnet-audit, just tailnet-sync, just seed-tailnet-oauth (verifies the secret before writing to Bitwarden).
  • tailscale role: pre-join cleanup now calls tailnet.py release.
  • docs/src/tailnet.md; inventory_parser gains parse_host_vars / set_host_var (comment-preserving).
  • k8s proxies (home cluster is parked, expected back) are not deleted unless --k8s-days is passed.

Verified

Local dry run against the live tailnet plans: delete 2 duplicates + 6 test VMs, rename himachal-1 and kerala-1, fix himachal's IP, drop kerala's override. Applying needs the new OAuth client (not done). Unit tests cover the planner and inventory edits.

@hanthor

hanthor commented Nov 18, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #348: every commit in this PR is also in #348 (refactor: migrate fleet configuration to native units).

Closed during the 2026-11-18 cleanup. The branch is kept, so this can be reopened.

@hanthor hanthor closed this Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant