Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [BUG] If tailscale_up_timeout is bigger than 60s... #426

Merged
merged 6 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,9 @@ If you need to view the unredacted value, see [`insecurely_log_authkey`](#insecu

### tailscale_up_timeout

**Default**: `120s`
**Default**: `120`

Defines the timeout duration for the `tailscale up` command.
Defines the timeout duration for the `tailscale up` command in seconds.

> --timeout duration
>
Expand Down
4 changes: 2 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ tailscale_authkey: ""
tailscale_args: ""
# Apply provided tags to node
tailscale_tags: []
# Set timeout for 'tailscale up' command
tailscale_up_timeout: "120s"
# Set timeout for 'tailscale up' command in seconds
tailscale_up_timeout: "120"

# Used for OAuth authentication
# Register as an ephemeral node (recommended)
Expand Down
4 changes: 2 additions & 2 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@

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

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

- name: Install | Report non-sensitive stdout from "tailscale up" # noqa: no-handler
Expand Down
9 changes: 9 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
- state != "absent"
- not tailscale_up_skip

- name: Tailscale timeout verification
ansible.builtin.fail:
msg: "`tailscale_up_timeout` variable should be parseable as an integer."
when:
- tailscale_up_timeout != 0
- (tailscale_up_timeout | type_debug == "bool") or not (tailscale_up_timeout | int)
artis3n marked this conversation as resolved.
Show resolved Hide resolved
- state != "absent"
- not tailscale_up_skip

- name: Use tailscale_tags instead of tailscale_args for tags
ansible.builtin.debug:
msg: You must use `tailscale_tags` instead of `tailscale_args` to assign tags.
Expand Down