artis3n/ansible-role-tailscale

[FEAT] Support setting custom IP addresses

ben-z opened this issue · 3 comments

Is your feature request related to a problem? Please describe.
The IP address of devices are auto-generated when using tailscale up. This makes it difficult to achieve infrastructure-as-code.

Describe the solution you'd like
Tailscale allows us to specify custom IP addresses (blog post, api endpoint). It would be awesome if this Ansible role can support this.

Describe alternatives you've considered
Using this role for tailscale up, then using a custom script to set the IP via the API.

Additional context
N/A

This works today following the node attribute configuration of that blog post - set a tag:X in the node attribute policy and use the tailscale_tags argument of this role to apply that tag to nodes managed by this role.

image

What alternate behavior/use case are you looking for from this role?

Interesting! Didn't know about this before. I'd like to assign a static IP address to each machine. I guess I could use IP pools of /32 but then it seems as complex as doing a custom API call separately.

I was hoping that this role can take in a static IP and call the POST /api/v2/device/{deviceID}/ip for me. But it's not too complex to issue an API request in a custom role. It seems that this role does everything through the CLI and doesn't interact with the API. Please feel free to close this issue if this is not a feature that you'd like to include in the role.

Hmm, yeah I would put this under the (growing) use cases of admin console API calls which are out of scope of this role, but suggest I should probably get around to converting this role into a collection and adding roles and plugins into the collection for these API use cases. This role I want to keep focused on behavior that can be configured on a node itself (e.g. the CLI).