artis3n / ansible-role-tailscale

Ansible role to install and configure a Tailscale node.
https://galaxy.ansible.com/artis3n/tailscale
MIT License
399 stars 67 forks source link

[BUG] Fails on an ipv6-only tailnet #502

Open growse opened 2 months ago

growse commented 2 months ago

Describe the bug The step "Facts | Get IPv4 address" fails when run on a machine attached to a v6-only tailnet.

To Reproduce Steps to reproduce the behavior:

  1. Create tailnet
  2. set disableIPv4: true in the tailnet acl.
  3. Run role on machine to join to tailnet
  4. See error

Expected behavior Role completes successfully

Screenshots

TASK [artis3n.tailscale : Facts | Get IPv4 address] **************************************************************************************************************************************************************************************************************************************
fatal: [guffnet-ch-01]: FAILED! => {"changed": false, "cmd": ["tailscale", "ip", "--4"], "delta": "0:00:00.021313", "end": "2024-09-03 14:37:21.667542", "msg": "non-zero return code", "rc": 1, "start": "2024-09-03 14:37:21.646229", "stderr": "no Tailscale IPv4 address", "stderr_lines": ["no Tailscale IPv4 address"], "stdout": "", "stdout_lines": []}

Target (please complete the following information):

Output of tailscale status during role execution (set verbose to true):

$ sudo tailscale status --peers=false
fd7a:115c:a1e0::c001:4f01 guffnet-ch-01        userid:15d52116014f28 linux   -

Additional context This worked in 4.4.2!

artis3n commented 2 months ago

Thanks - we'll need to set the IPv4 and IPv6 facts to have an empty default to prevent task failures