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

Approve machine as exit node #213

Open
OJFord opened this issue Mar 7, 2023 · 2 comments
Open

Approve machine as exit node #213

OJFord opened this issue Mar 7, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@OJFord
Copy link

OJFord commented Mar 7, 2023

Is your feature request related to a problem? Please describe.
When a machine starts up with --advertise-exit-node, it must be manually enabled in the UI:

2023-03-07T23:37:22,703653119+00:00

Describe the solution you'd like
Something in terraform. Perhaps similarly to device_authorization:

data "tailscale_device" "sample_device" {
  name = "device.example.com"
}

resource "tailscale_device_exit_node" "sample_device" {
  device_id  = data.tailscale_device.sample_device.id
  exit_node = true
}

or perhaps it's an opportunity to refactor that into a single tailscale_device_settings or something.

Additional context

@OJFord OJFord added the enhancement New feature or request label Mar 7, 2023
@mayakacz
Copy link
Contributor

mayakacz commented Mar 9, 2023

You can approve a device's advertised routes via the API (they still need to be advertised from the device): https://github.com/tailscale/tailscale/blob/main/api.md#set-device-routes. This requires specifying the route.

You could also address this with auto approvers: https://tailscale.com/kb/1018/acls/#auto-approvers-for-routes-and-exit-nodes. You could tag the auth key or OAuth client the Terraform provider uses, and allow that tag to approve whatever routes you expect.

@mhutter
Copy link
Contributor

mhutter commented Sep 1, 2023

Through some diggging I found out that an "Exit node" is just a node that routes 0.0.0.0/0 and ::/0, so to achieve this just add those two routes (with tailscale_device_subnet_routes).

See: #279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants