Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit 8bf2072

Browse files
McSim85artis3n
andauthored
fix: [BUG] If tailscale_up_timeout is bigger than 60s... (#426)
* fix: [BUG] If tailscale_up_timeout is bigger than 60s... * add type check * fix fail condition * add zero check condition --------- Co-authored-by: Ari Kalfus <[email protected]>
1 parent 1fe9171 commit 8bf2072

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,9 @@ If you need to view the unredacted value, see [`insecurely_log_authkey`](#insecu
235235

236236
### tailscale_up_timeout
237237

238-
**Default**: `120s`
238+
**Default**: `120`
239239

240-
Defines the timeout duration for the `tailscale up` command.
240+
Defines the timeout duration for the `tailscale up` command in seconds.
241241

242242
> --timeout duration
243243
>

defaults/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ tailscale_authkey: ""
99
tailscale_args: ""
1010
# Apply provided tags to node
1111
tailscale_tags: []
12-
# Set timeout for 'tailscale up' command
13-
tailscale_up_timeout: "120s"
12+
# Set timeout for 'tailscale up' command in seconds
13+
tailscale_up_timeout: "120"
1414

1515
# Used for OAuth authentication
1616
# Register as an ephemeral node (recommended)

tasks/install.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113

114114
- name: Install | Build the final tailscale_args
115115
ansible.builtin.set_fact:
116-
tailscale_args_string: "{{ tailscale_args }} {{ tailscale_tags_string | trim }} --timeout={{ tailscale_up_timeout | trim }}"
116+
tailscale_args_string: "{{ tailscale_args }} {{ tailscale_tags_string | trim }} --timeout={{ tailscale_up_timeout | trim }}s"
117117

118118
- name: Install | Final `tailscale up` arguments string
119119
ansible.builtin.debug:
@@ -142,7 +142,7 @@
142142
- not tailscale_up_skip
143143
- state_file is changed or not tailscale_is_online
144144
notify: Confirm Tailscale is Connected
145-
async: 60
145+
async: "{{ (tailscale_up_timeout | trim | int) + 10 }}"
146146
poll: 5
147147

148148
- name: Install | Report non-sensitive stdout from "tailscale up" # noqa: no-handler

tasks/main.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@
2727
- state != "absent"
2828
- not tailscale_up_skip
2929

30+
- name: Tailscale timeout verification
31+
ansible.builtin.fail:
32+
msg: "`tailscale_up_timeout` variable should be parseable as an integer."
33+
when:
34+
- tailscale_up_timeout != 0
35+
- (tailscale_up_timeout | type_debug == "bool") or not (tailscale_up_timeout | int)
36+
- state != "absent"
37+
- not tailscale_up_skip
38+
3039
- name: Use tailscale_tags instead of tailscale_args for tags
3140
ansible.builtin.debug:
3241
msg: You must use `tailscale_tags` instead of `tailscale_args` to assign tags.

0 commit comments

Comments
 (0)