diff --git a/tasks/uninstall.yml b/tasks/uninstall.yml index 973b23c..3cdbeb8 100644 --- a/tasks/uninstall.yml +++ b/tasks/uninstall.yml @@ -5,10 +5,44 @@ failed_when: false register: tailscale_status +- name: Uninstall | Add debug message + ansible.builtin.debug: + msg: "{{ tailscale_status }}" + +- name: Uninstall | Run tailscale bugreport before logout + ansible.builtin.command: tailscale bugreport + changed_when: false + failed_when: false + register: tailscale_bugreport + +- name: Uninstall | Add debug message + ansible.builtin.debug: + msg: "{{ tailscale_bugreport }}" + +- name: Uninstall | List content of /var/lib/tailscale + ansible.builtin.command: ls -la /var/lib/tailscale + changed_when: false + failed_when: false + register: tailscale_lib_dir + +- name: Uninstall | Add debug message + ansible.builtin.debug: + msg: "{{ tailscale_lib_dir }}" + +- name: Uninstall | Gather tailscale version + ansible.builtin.command: tailscale version + changed_when: false + failed_when: false + register: tailscale_version + +- name: Uninstall | Add debug message + ansible.builtin.debug: + msg: "{{ tailscale_version }}" + - name: Uninstall | De-register Tailscale Node become: true # Hack to get correct changed/ok status - ansible.builtin.shell: tailscale status; tailscale logout + ansible.builtin.shell: tailscale status; tailscale logout ; tailscale bugreport register: tailscale_logout changed_when: "'Logged out.' not in tailscale_status.stdout and 'not logged in' not in tailscale_status.stdout" when: @@ -16,6 +50,8 @@ - tailscale_status.rc != 2 # "bash: tailscale: command not found" - tailscale_status.rc != 127 + # "Tailscale is stopped." + - tailscale_status.rc != 1 - name: Uninstall | Delete Tailscale State ansible.builtin.file: