Skip to content

Switch to Tailscale OAuth key#2045

Open
domgz wants to merge 3 commits intousegalaxy-eu:masterfrom
domgz:tailscale_auth_keys
Open

Switch to Tailscale OAuth key#2045
domgz wants to merge 3 commits intousegalaxy-eu:masterfrom
domgz:tailscale_auth_keys

Conversation

@domgz
Copy link
Copy Markdown
Contributor

@domgz domgz commented May 7, 2026

Rather than using a Tailscale Auth key (which is valid for a maximum of 90 days) to connect the Celery VM to Tailscale so that the Flower dashboard becomes available, use an OAuth key (which is indefinitely valid).

Tailscale requires assigning tags when connecting via OAuth: define the galaxy tag so that any node where the Tailscale role runs is assigned this tag when it connects to the Tailscale network. Connect every node as an ephemeral host, so that they are dynamically added to and removed from the Tailscale network.

Supersedes #2044.

domgz added 2 commits May 7, 2026 13:53
Replace the Tailscale API key in traefik.yml with a freshly minted one so that the new Celery VM can connect to Tailscale and the Flower dashboard becomes available.

Note: Tailscale auth keys are valid for a max of 90 days. After this period, the host will not disconnect itself from the network, but the key won't be valid to connect new hosts to the network.
Rather than using a Tailscale Auth key (which is valid for a maximum of 90 days) to connect the Celery VM to Tailscale so that the Flower dashboard becomes available, use an OAuth key (which is indefinitely valid).

Tailscale requires assigning tags when connecting via OAuth: define the `galaxy` tag so that any node where the Tailscale role runs is assigned this tag when it connects to the Tailscale network. Connect every node as an ephemeral host, so that they are dynamically added to and removed from the Tailscale network.
@domgz domgz requested a review from gsaudade99 May 7, 2026 12:25
@domgz domgz self-assigned this May 7, 2026
@domgz
Copy link
Copy Markdown
Contributor Author

domgz commented May 7, 2026

@gsaudade99 I will try this out manually before merging it.

@gsaudade99
Copy link
Copy Markdown
Contributor

Cool, this looks really nice. I would also update the outdated role - now is a collection - if you already hands on with it ... I also understand if not sense we would need to make sure that traefik-proxy playbook also run ...

@domgz
Copy link
Copy Markdown
Contributor Author

domgz commented May 7, 2026

[...] I would also update the outdated role - now is a collection - if you already hands on with it [...]

Upgrade here #2047.

@domgz
Copy link
Copy Markdown
Contributor Author

domgz commented May 7, 2026

@gsaudade99 Would you mind reviewing again? 6fb89fd makes the use of the OAuth key global. The idea is that anything we connect to the tailnet will use this key (and will be tagged with the galaxy tag).

Extend the scope of the Tailscale OAuth key to the whole infrastructure rather than just Celery.
@domgz domgz force-pushed the tailscale_auth_keys branch from 300c661 to 6fb89fd Compare May 7, 2026 13:11
@domgz domgz marked this pull request as ready for review May 7, 2026 13:11
Copy link
Copy Markdown
Contributor

@gsaudade99 gsaudade99 left a comment

Choose a reason for hiding this comment

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

The rest the setup looks good

@@ -0,0 +1,10 @@
$ANSIBLE_VAULT;1.1;AES256
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we move this to secret_group_vars directory?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Files in the group_vars/ directory are automatically discovered by Ansible. It is thus then not necessary to include those files under vars_files: in the playbooks and they follow the variable precedence rules.

Files in the folder secret_group_vars are not automatically discovered nor managed by Ansible, they have to be explicitly included under vars_files: in the playbooks, and do not allow to exploit the variable precedence rules to override values (they belong to level 14).

Comment thread celery.yml
roles:
- geerlingguy.repo-epel
# - artis3n.tailscale # broken (invalid API key)
- role: artis3n.tailscale
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Change this to match the collection.
There is also missing the import of group_vars/tailscale.yml

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Variables under group_vars/ do not need to be imported #2045 (comment). For the collection I have created the other, independent PR #2047.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants