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

Add Support for Auto Updates #109

Open
jason-riddle opened this issue May 15, 2024 · 1 comment
Open

Add Support for Auto Updates #109

jason-riddle opened this issue May 15, 2024 · 1 comment

Comments

@jason-riddle
Copy link
Owner

jason-riddle commented May 15, 2024

Tailscale now supports auto updates.

This feature was made GA on Feb 14 (https://tailscale.com/changelog#2024-02-14). It was first introduced, in beta, on Oct 30, 2023 in v1.52.0 (https://tailscale.com/changelog#2023-10-30)

To enable auto updates, run tailscale set --auto-update=true. Here's an example in ansible

- name: Enable auto updates.
  command: tailscale set --auto-update=true
  changed_when: false

To disable auto updates, run tailscale set --auto-update=false. Here's an example in ansible

- name: Disable auto updates.
  command: tailscale set --auto-update=false
  changed_when: false

You can also run a one-off command like so

ansible cluster --module-name ansible.builtin.command --args='tailscale set --auto-update=false' --one-line

Perhaps tailscale status --json will show the current value?

See https://tailscale.com/kb/1067/update?tab=linux for more info.

What would be nice is if there was a way to configure this in a native ansible manner. So maybe,

tailscale_auto_update_enabled: false

Which means, by default leave it as disabled. To enable, set the variable to true.

@jason-riddle
Copy link
Owner Author

jason-riddle commented May 18, 2024

I've been thinking about this more and this might not be a good feature to implement.

tailscale set has a lot things you can set (https://tailscale.com/kb/1080/cli#set). So I'm not sure if the best approach is to have a variable per thing I want to set, so for auto updates, it's

tailscale_auto_update_enabled: false

Or do I want something more flexible, as an example a way to set multiple flags

tailscale_set_flags:
  - accept-dns: true
  - auto-update: false
  # - etc..

The first approach is cleaner and would be simpler to test. I think maintenance would be fine as long as the tailscale set --auto-update flag doesn't go away.

The second approach would be harder to implement and test. However, it offers a lot of flexiblity to a) set current and future flags as they exist and b) remove flags if for some reason they become deprecated.

A third option is to just add another molecule test that a) sets the update flag to true, b) confirm's it's been set to true, and vice versa for setting it to false. Also, update the README to include information on how to set the flag via a one-off ansible command under a "Ad Hoc Command - Configuring Automatic Updates" section.

Something for setting it to true

ansible cluster --module-name ansible.builtin.command --args='tailscale set --auto-update=true' --one-line

and for setting it to false

ansible cluster --module-name ansible.builtin.command --args='tailscale set --auto-update=false' --one-line

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

No branches or pull requests

1 participant