if node.os != "alpine": raise BundleError(f"{node.name}: OS {node.os} is not supported.") svc_openrc = { "tailscale": { "enabled": True, "running": True, "needs": [ "pkg_apk:tailscale", ], }, } tailscale_authkey = node.metadata.get("tailscale/authkey", None) if not tailscale_authkey: raise KeyError actions = { "tailscale_up": { "command": f"tailscale up --authkey={tailscale_authkey}", "needs": [ "pkg_apk:tailscale", "svc_openrc:tailscale", ], "unless": "tailscale ip -1 >/dev/null 2>&1", }, "tailscale_advertise_exit_node": { "command": "tailscale set --advertise-exit-node", "interactive": False, # doesn't hurt to run every time "needs": [ "pkg_apk:tailscale", "svc_openrc:tailscale", # "action:tailscale_up", ? ], }, } # TODO: metrics https://forum.tailscale.com/t/monitor-tailscale-by-prometheus/2315