- Removal passes on a host without a tailscaled unit, and the best-effort logout reports a change only when it succeeded. - Under --check the service tasks run only when the unit exists, also with --tags configure on a host without the package. - The auth key is required before any change only when the run includes the configure tasks; --tags remove, install and update need none. The assert in the up block stays as the hard guard. - When the flags change or tailscaled is not active, the role clears its failure state and restarts it at once, so a daemon the package started without a TUN device does not stay in the start limit. - The health tag is back on the configure include. - The scenario tests removal without purge (state and defaults kept, a second removal passes) and a purge with a state directory the package does not delete itself, and waits for tailscaled to be active. Assisted-by: Claude Code:claude-opus-5-5
31 lines
951 B
YAML
31 lines
951 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, health]
|
|
|
|
- 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
|