fix: Handle missing 'online' field in Tailscale API response
All checks were successful
Deploy Cluster / Terraform (push) Successful in 2m12s
Deploy Cluster / Ansible (push) Successful in 9m19s

This commit is contained in:
2026-03-29 13:52:23 +00:00
parent 5269884408
commit efdf13976a

View File

@@ -16,7 +16,14 @@
{{ ts_devices.json.devices | default([]) {{ ts_devices.json.devices | default([])
| selectattr('hostname', 'defined') | selectattr('hostname', 'defined')
| selectattr('hostname', 'in', tailscale_reserved_hostnames) | selectattr('hostname', 'in', tailscale_reserved_hostnames)
| rejectattr('online', 'true') | rejectattr('online', 'defined')
| list
+
ts_devices.json.devices | default([])
| selectattr('hostname', 'defined')
| selectattr('hostname', 'in', tailscale_reserved_hostnames)
| selectattr('online', 'defined')
| rejectattr('online', 'equalto', true)
| list }} | list }}
- name: Delete stale devices - name: Delete stale devices