Two tailscale role behaviours that #398 carried over unchanged from the source role. Both were found in the independent review of #398. Each changes behaviour, so each needs a maintainer decision before an agent picks it up.
1. tailscale up runs on any state other than Running
tasks/configure.yml runs tailscale up --auth-key=file:… whenever BackendState is anything other than Running. That includes an enrolled node that someone stopped with tailscale down (Stopped), and transient states such as Starting. On such a node:
up can fail with "requires mentioning all non-default flags", when the node was brought up with other flags earlier;
or it fails because the auth key was one-off or has expired. Re-using a key on an enrolled node is the common case, since the key is only needed for first enrolment.
The role then fails a run on a node that is fine, or it silently re-enables a node that an operator took down on purpose.
Proposed: run up only on NeedsLogin or NoState. For Stopped, either leave the node alone and report it, or run a plain tailscale up without the key. With either change, the key assert in validate.yml and in the up block follows the narrower condition.
Decision needed:
(a) only NeedsLogin/NoState, and leave Stopped alone (recommended: the role does not override an operator's tailscale down);
(b) as (a), but Stopped gets a plain tailscale up;
(c) keep the current behaviour and document it.
2. The userspace-networking flag is matched on one spelling only
tasks/configure.yml recognises only the exact token --tun=userspace-networking in FLAGS of /etc/default/tailscaled. Some spellings are neither removed when tailscale_userspace_networking: false nor de-duplicated when true:
a hand-written -tun=userspace-networking;
--tun userspace-networking (a space instead of =);
another --tun=<value>.
So FLAGS can end up with two --tun flags, or keep the flag after the input was turned off.
Proposed: treat any -tun/--tun flag (with = or a space) as the role's own. When true, replace it with --tun=userspace-networking; when false, remove it. Another --tun=<value> is either overwritten or refused with a message.
Decision needed:
whether the role owns every --tun flag (overwrite), or refuses a foreign --tun value;
whether this is worth the regex at all, given that nothing but the role writes FLAGS on managed hosts.
Tests
Molecule: for item 1, a node that is not enrolled stays at NeedsLogin under userspace networking, so only that path can be exercised. Stopped needs an enrolled node, so the state decision is tested at the task level: run with a faked __tailscale_status result in the refusal/assert style of verify.yml. For item 2, seed FLAGS with each spelling in verify.yml, then assert the result for true and for false.
Semver: a behaviour change, so minor_changes (breaking_changes if option 1a is called breaking).
Two `tailscale` role behaviours that #398 carried over unchanged from the source role. Both were found in the independent review of #398. Each changes behaviour, so each needs a maintainer decision before an agent picks it up.
## 1. `tailscale up` runs on any state other than Running
`tasks/configure.yml` runs `tailscale up --auth-key=file:…` whenever `BackendState` is anything other than `Running`. That includes an enrolled node that someone stopped with `tailscale down` (`Stopped`), and transient states such as `Starting`. On such a node:
- `up` can fail with "requires mentioning all non-default flags", when the node was brought up with other flags earlier;
- or it fails because the auth key was one-off or has expired. Re-using a key on an enrolled node is the common case, since the key is only needed for first enrolment.
The role then fails a run on a node that is fine, or it silently re-enables a node that an operator took down on purpose.
**Proposed:** run `up` only on `NeedsLogin` or `NoState`. For `Stopped`, either leave the node alone and report it, or run a plain `tailscale up` without the key. With either change, the key assert in `validate.yml` and in the `up` block follows the narrower condition.
**Decision needed:**
- (a) only `NeedsLogin`/`NoState`, and leave `Stopped` alone (recommended: the role does not override an operator's `tailscale down`);
- (b) as (a), but `Stopped` gets a plain `tailscale up`;
- (c) keep the current behaviour and document it.
## 2. The userspace-networking flag is matched on one spelling only
`tasks/configure.yml` recognises only the exact token `--tun=userspace-networking` in `FLAGS` of `/etc/default/tailscaled`. Some spellings are neither removed when `tailscale_userspace_networking: false` nor de-duplicated when `true`:
- a hand-written `-tun=userspace-networking`;
- `--tun userspace-networking` (a space instead of `=`);
- another `--tun=<value>`.
So `FLAGS` can end up with two `--tun` flags, or keep the flag after the input was turned off.
**Proposed:** treat any `-tun`/`--tun` flag (with `=` or a space) as the role's own. When `true`, replace it with `--tun=userspace-networking`; when `false`, remove it. Another `--tun=<value>` is either overwritten or refused with a message.
**Decision needed:**
- whether the role owns every `--tun` flag (overwrite), or refuses a foreign `--tun` value;
- whether this is worth the regex at all, given that nothing but the role writes `FLAGS` on managed hosts.
## Tests
- **Molecule:** for item 1, a node that is not enrolled stays at `NeedsLogin` under userspace networking, so only that path can be exercised. `Stopped` needs an enrolled node, so the state decision is tested at the task level: run with a faked `__tailscale_status` result in the refusal/assert style of `verify.yml`. For item 2, seed `FLAGS` with each spelling in `verify.yml`, then assert the result for `true` and for `false`.
- **Semver:** a behaviour change, so `minor_changes` (`breaking_changes` if option 1a is called breaking).
Depends on #398.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.
Two
tailscalerole behaviours that #398 carried over unchanged from the source role. Both were found in the independent review of #398. Each changes behaviour, so each needs a maintainer decision before an agent picks it up.1.
tailscale upruns on any state other than Runningtasks/configure.ymlrunstailscale up --auth-key=file:…wheneverBackendStateis anything other thanRunning. That includes an enrolled node that someone stopped withtailscale down(Stopped), and transient states such asStarting. On such a node:upcan fail with "requires mentioning all non-default flags", when the node was brought up with other flags earlier;The role then fails a run on a node that is fine, or it silently re-enables a node that an operator took down on purpose.
Proposed: run
uponly onNeedsLoginorNoState. ForStopped, either leave the node alone and report it, or run a plaintailscale upwithout the key. With either change, the key assert invalidate.ymland in theupblock follows the narrower condition.Decision needed:
NeedsLogin/NoState, and leaveStoppedalone (recommended: the role does not override an operator'stailscale down);Stoppedgets a plaintailscale up;2. The userspace-networking flag is matched on one spelling only
tasks/configure.ymlrecognises only the exact token--tun=userspace-networkinginFLAGSof/etc/default/tailscaled. Some spellings are neither removed whentailscale_userspace_networking: falsenor de-duplicated whentrue:-tun=userspace-networking;--tun userspace-networking(a space instead of=);--tun=<value>.So
FLAGScan end up with two--tunflags, or keep the flag after the input was turned off.Proposed: treat any
-tun/--tunflag (with=or a space) as the role's own. Whentrue, replace it with--tun=userspace-networking; whenfalse, remove it. Another--tun=<value>is either overwritten or refused with a message.Decision needed:
--tunflag (overwrite), or refuses a foreign--tunvalue;FLAGSon managed hosts.Tests
NeedsLoginunder userspace networking, so only that path can be exercised.Stoppedneeds an enrolled node, so the state decision is tested at the task level: run with a faked__tailscale_statusresult in the refusal/assert style ofverify.yml. For item 2, seedFLAGSwith each spelling inverify.yml, then assert the result fortrueand forfalse.minor_changes(breaking_changesif option 1a is called breaking).Depends on #398.
🤖 Generated with Claude Code