Installs Tailscale from the upstream APT repository with the keyring pinned by sha256, enables tailscaled and, with tailscale_up (default true), runs tailscale up with tailscale_auth_key while the node is not Running. It can also update to the APT candidate version and remove or purge. The role asserts Ubuntu and follows the host's release, and requires a non-empty auth key before any change whenever tailscale up will run. tailscale_userspace_networking now sets --tun=userspace-networking in the FLAGS of /etc/default/tailscaled, where tailscaled reads it, instead of passing it to tailscale up. The molecule scenario installs the real package on noble and resolute without joining a tailnet, and covers the update and purge paths and the refusal cases. Closes #396 Assisted-by: Claude Code:claude-opus-5-5
31 lines
943 B
YAML
31 lines
943 B
YAML
---
|
|
# Validation first, under always, so a bad input fails before any change whatever tags the run
|
|
# selects.
|
|
- name: Validate the role inputs
|
|
ansible.builtin.import_tasks: validate.yml
|
|
tags: always
|
|
|
|
- name: Remove Tailscale (explicit only)
|
|
ansible.builtin.include_tasks: remove.yml
|
|
when: tailscale_remove | bool
|
|
tags: [tailscale, remove]
|
|
|
|
- name: Install Tailscale
|
|
ansible.builtin.include_tasks: install.yml
|
|
tags: [tailscale, install]
|
|
|
|
- name: Configure Tailscale
|
|
ansible.builtin.include_tasks: configure.yml
|
|
tags: [tailscale, configure]
|
|
|
|
- name: Ensure Tailscale is up-to-date
|
|
ansible.builtin.include_tasks: update.yml
|
|
when:
|
|
- tailscale_update | bool
|
|
# Under --check a new source line is only simulated, so apt would have no candidate.
|
|
- not ansible_check_mode or __tailscale_apt_source | default({}) is not changed
|
|
tags: [tailscale, update]
|
|
|
|
- name: Flush handlers
|
|
ansible.builtin.meta: flush_handlers
|