Skip to content

Commit

Permalink
Automatically check for valid tailscale authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
gizmoguy committed Sep 29, 2024
1 parent 2ce6032 commit b97d7b5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tasks/auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,17 @@

- name: Prompt user to authenticate with tailscale in web browser
ansible.builtin.pause:
prompt: |-
seconds: 1
prompt: |
To authenticate {{ inventory_hostname }} with tailscale, visit:
{{ _tailscale_state.AuthURL }}
Press enter to continue
- name: Wait for device to be authenticated and approved
ansible.builtin.command:
cmd: "tailscale status --peers=false --json"
register: _tailscale_status_cmd
retries: 30
delay: 10
until: (_tailscale_status_cmd.stdout | from_json).BackendState == "Running"
changed_when: false

0 comments on commit b97d7b5

Please sign in to comment.