Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set filename to support auto update feature #449

Merged
merged 1 commit into from
Mar 15, 2024
Merged

Conversation

cnkk
Copy link
Contributor

@cnkk cnkk commented Mar 14, 2024

The Tailscale client auto-update feature requires the sources list file in /etc/apt/sources.list.d/tailscale.list otherwise it won't work.

Source file will be saved as sources.list.d/tailscale.list
@artis3n
Copy link
Owner

artis3n commented Mar 14, 2024

@cnkk Can you link to Tailscale documentation or describe how you came to this realization? I can't see any reference to this in https://tailscale.com/kb/1067/update .

Though this seems to have happened by default on my real Debian system:
image

Also, I'm a fan of Plausible :)

@cnkk
Copy link
Contributor Author

cnkk commented Mar 14, 2024

Hi!

The auto update feature just triggers a tailscale update and it does not work.

exporter:~# tailscale update
This will update Tailscale from 1.60.1 to 1.62.0. Continue? [y/n] y
open /etc/apt/sources.list.d/tailscale.list: no such file or directory

And this when auto update is enabled:

Mar 14 21:50:29 exporter tailscaled[37719]: c2n: POST /update received
Mar 14 21:50:29 exporter tailscaled[37719]: c2n: running "systemd-run --wait --pipe --collect /usr/bin/tailscale update --yes"
Mar 14 21:50:29 exporter tailscaled[37719]: c2n: GET /update received
Mar 14 21:50:30 exporter tailscaled[37719]: c2n: update command failed: exit status 1, output: Running as unit: run-u958.service
Mar 14 21:50:30 exporter tailscaled[37719]: Updating Tailscale from 1.60.1 to 1.62.0; --yes given, continuing without prompts.
Mar 14 21:50:30 exporter tailscaled[37719]: open /etc/apt/sources.list.d/tailscale.list: no such file or directory
Mar 14 21:50:30 exporter tailscaled[37719]: Finished with result: exit-code
Mar 14 21:50:30 exporter tailscaled[37719]: Main processes terminated with: code=exited/status=1
Mar 14 21:50:30 exporter tailscaled[37719]: Service runtime: 338ms

I think this is the part in the source code: https://github.com/tailscale/tailscale/blob/08ebac9acb5d4a6d2ae6b01f282f1f0807c7561d/clientupdate/clientupdate.go#L428

@artis3n
Copy link
Owner

artis3n commented Mar 14, 2024

Thanks, that would do it! What is the sources list filename that you are seeing assigned of tailscale.list? We'll definitely merge this in but I want to better understand what's going on, see if we need to make changes to other distros, maybe file an issue up to Tailscale.

[Edit] Taking a look -

Ubuntu 22.04:

  • /etc/apt/sources.list.d/pkgs_tailscale_com_stable_ubuntu.list

Amazon 2023 / Rocky Linux 9 / Fedora (we set it explicitly in the role):

  • /etc/yum.repos.d/tailscale.repo

OpenSUSE:

  • /etc/zypp/repos.d/tailscale-stable.repo

Confirming this behavior is specific to Debian distros, and introduced by this role, not upstream. https://docs.ansible.com/ansible/latest/collections/ansible/builtin/apt_repository_module.html will use the repository source URL to generate a file name unless we provide it.

Doesn't seem like we can tweak the OpenSUSE repo name, since trying to rename it to tailscale fails:

fatal: [instance]: FAILED! => {"changed": false, "msg": "Incompatible option: 'name'. Do not use name when adding .repo files"}

So seems like the only change needed is to the Debian install.

Copy link
Owner

@artis3n artis3n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to follow up this PR with a new Molecule test to run tailscale update and ensure we don't introduce a regression in the future.

@artis3n artis3n merged commit 48d23a9 into artis3n:main Mar 15, 2024
32 checks passed
Repository owner deleted a comment from dryrunsecurity bot Mar 15, 2024
@cnkk cnkk deleted the patch-1 branch March 15, 2024 10:59
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.

None yet

2 participants