No tailscale_system_type. The role asserts Ubuntu, and tailscale_apt_release follows the host's release. It declares noble and resolute.
New tailscale_up (default true). The key has no default. A non-empty tailscale_auth_key is asserted before any change, but only when the configure step runs. --tags remove, update and health need no key; the README lists the tags that do. The up block repeats the assert.
tailscale_userspace_networking sets --tun=userspace-networking in FLAGS in /etc/default/tailscaled. Other flags and PORT are kept, and setting the input to false removes the flag. When FLAGS changed or tailscaled is not active, the role runs systemctl reset-failed and restarts the daemon at once.
No legacy-name guards. Internal names carry __tailscale_.
Scenario: a real install, no enrolment. It covers the update path from a downgrade, removal without purge (state dir and defaults kept), a second removal with no unit, a purge on a non-default tailscale_state_dir, and 5 refusal cases.
#396 says molecule tests noble. roles/AGENTS.md ("declared means tested") requires every declared platform to be tested, so the scenario runs noble and resolute, as pihole and docker do.
With the configure step selected, tailscale_remove: true still requires the key, because up runs after the logout. Failing after the removal would be worse.
Fixes over the source role, found in an independent review:
Removal works on a host with no tailscaled unit.
--check --tags configure works on a fresh host.
tailscale logout reports a change only when it succeeds.
Unchanged, as in the source role:
Any backend state other than Running triggers tailscale up.
Only the exact token --tun=userspace-networking is recognised.
## What and why
Closes #396
Adds `tailscale`. The role:
- installs Tailscale from pkgs.tailscale.com, with the keyring pinned by sha256;
- enables `tailscaled`;
- runs `tailscale up` with an auth key while the node is not Running;
- can update to the APT candidate version, and remove or purge.
It also updates the README role list and Roadmap (wave 2 is now just `pve_vm`), the galaxy.yml description, and adds a `minor_changes` fragment.
Decisions from #396, as applied:
- **No `tailscale_system_type`.** The role asserts Ubuntu, and `tailscale_apt_release` follows the host's release. It declares noble and resolute.
- **New `tailscale_up`** (default `true`). The key has no default. A non-empty `tailscale_auth_key` is asserted before any change, but only when the configure step runs. `--tags remove`, `update` and `health` need no key; the README lists the tags that do. The `up` block repeats the assert.
- **`tailscale_userspace_networking`** sets `--tun=userspace-networking` in `FLAGS` in `/etc/default/tailscaled`. Other flags and `PORT` are kept, and setting the input to false removes the flag. When `FLAGS` changed or `tailscaled` is not active, the role runs `systemctl reset-failed` and restarts the daemon at once.
- **No legacy-name guards.** Internal names carry `__tailscale_`.
- **Scenario: a real install, no enrolment.** It covers the update path from a downgrade, removal without purge (state dir and defaults kept), a second removal with no unit, a purge on a non-default `tailscale_state_dir`, and 5 refusal cases.
**Deviations from #396, for the maintainer:**
- #396 says molecule tests `noble`. roles/AGENTS.md ("declared means tested") requires every declared platform to be tested, so the scenario runs noble **and** resolute, as pihole and docker do.
- With the configure step selected, `tailscale_remove: true` still requires the key, because `up` runs after the logout. Failing after the removal would be worse.
**Fixes over the source role**, found in an independent review:
- Removal works on a host with no `tailscaled` unit.
- `--check --tags configure` works on a fresh host.
- `tailscale logout` reports a change only when it succeeds.
**Unchanged, as in the source role:**
- Any backend state other than Running triggers `tailscale up`.
- Only the exact token `--tun=userspace-networking` is recognised.
## Verified
- Commit hooks (ansible-lint production, yamllint, REUSE, changelog lint, gitleaks) and pre-push `ansible-test sanity`.
- `--syntax-check` on converge/verify, and `ansible-doc -t role mortis.kamino.tailscale`.
- verify's refusal cases against localhost: 5/5 stopped on the intended message.
- The key requirement under real `--tags` runs on localhost.
- The FLAGS computation: 7 cases in a scratch play.
## Not verified
- Molecule itself (CI only), including the restart handling and both removal paths.
- `tailscale up` and enrolment (excluded by decision).
- Switching userspace networking back to false on a host (needs `/dev/net/tun`).
- The tag check inside the scenario: tags cannot be faked within a play.
---
- [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none.
Assisted-by: Claude Code:claude-opus-5-5
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Installs Tailscale from the upstream APT repository with the keyring
pinned by sha256, enables tailscaled and, with tailscale_up (default
true), runs tailscale up with tailscale_auth_key while the node is not
Running. It can also update to the APT candidate version and remove or
purge.
The role asserts Ubuntu and follows the host's release, and requires a
non-empty auth key before any change whenever tailscale up will run.
tailscale_userspace_networking now sets --tun=userspace-networking in
the FLAGS of /etc/default/tailscaled, where tailscaled reads it, instead
of passing it to tailscale up.
The molecule scenario installs the real package on noble and resolute
without joining a tailnet, and covers the update and purge paths and
the refusal cases.
Closes#396
Assisted-by: Claude Code:claude-opus-5-5
- Removal passes on a host without a tailscaled unit, and the
best-effort logout reports a change only when it succeeded.
- Under --check the service tasks run only when the unit exists, also
with --tags configure on a host without the package.
- The auth key is required before any change only when the run includes
the configure tasks; --tags remove, install and update need none. The
assert in the up block stays as the hard guard.
- When the flags change or tailscaled is not active, the role clears its
failure state and restarts it at once, so a daemon the package started
without a TUN device does not stay in the start limit.
- The health tag is back on the configure include.
- The scenario tests removal without purge (state and defaults kept, a
second removal passes) and a purge with a state directory the package
does not delete itself, and waits for tailscaled to be active.
Assisted-by: Claude Code:claude-opus-5-5
CODEOWNERS rules
requested review from Defame1297 2026-11-26 20:54:48 +00:00
After a removal without purge the role has disabled tailscaled, so the
reinstall's postinst does not start it. systemd then unloads the inactive,
unreferenced unit, and `systemctl reset-failed tailscaled` exits 1 with
"Unit tailscaled.service not loaded.", failing the configure step on both
noble and resolute. An unloaded unit has no failure state to clear, and the
restart that follows loads it, so that one error is not a failure.
Assisted-by: Claude Code:claude-opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What and why
Closes #396
Adds
tailscale. The role:tailscaled;tailscale upwith an auth key while the node is not Running;It also updates the README role list and Roadmap (wave 2 is now just
pve_vm), the galaxy.yml description, and adds aminor_changesfragment.Decisions from #396, as applied:
tailscale_system_type. The role asserts Ubuntu, andtailscale_apt_releasefollows the host's release. It declares noble and resolute.tailscale_up(defaulttrue). The key has no default. A non-emptytailscale_auth_keyis asserted before any change, but only when the configure step runs.--tags remove,updateandhealthneed no key; the README lists the tags that do. Theupblock repeats the assert.tailscale_userspace_networkingsets--tun=userspace-networkinginFLAGSin/etc/default/tailscaled. Other flags andPORTare kept, and setting the input to false removes the flag. WhenFLAGSchanged ortailscaledis not active, the role runssystemctl reset-failedand restarts the daemon at once.__tailscale_.tailscale_state_dir, and 5 refusal cases.Deviations from #396, for the maintainer:
noble. roles/AGENTS.md ("declared means tested") requires every declared platform to be tested, so the scenario runs noble and resolute, as pihole and docker do.tailscale_remove: truestill requires the key, becauseupruns after the logout. Failing after the removal would be worse.Fixes over the source role, found in an independent review:
tailscaledunit.--check --tags configureworks on a fresh host.tailscale logoutreports a change only when it succeeds.Unchanged, as in the source role:
tailscale up.--tun=userspace-networkingis recognised.Verified
ansible-test sanity.--syntax-checkon converge/verify, andansible-doc -t role mortis.kamino.tailscale.--tagsruns on localhost.Not verified
tailscale upand enrolment (excluded by decision)./dev/net/tun).NOTICEandREUSE.toml, or there is none.Assisted-by: Claude Code:claude-opus-5-5
🤖 Generated with Claude Code