Installs cloudflared as a systemd service for a locally managed Cloudflare Tunnel: checks that the tunnel exists, manages its proxied CNAMEs, renders config.yml and the credentials file, and updates the binary through the internal _binary_update role. The opt-in mint entry point creates the tunnel and registers its id and credentials as no_log facts for the calling play to persist. Validation runs first under always and asserts the tunnel secrets with the mint instructions; the secrets stay optional in the argument spec on purpose. cloudflared_manage_dns lets the records be managed elsewhere. A removal now ends the role. Assisted-by: Claude Code:claude-opus-5-5
49 lines
2.2 KiB
YAML
49 lines
2.2 KiB
YAML
---
|
|
cloudflared_update: true
|
|
cloudflared_remove_data: false
|
|
cloudflared_remove: false
|
|
|
|
# cloudflared publishes no checksum file: the hash is the sha256 of the cloudflared-linux-amd64
|
|
# release asset, and it moves together with the version. Pin both in inventory to move the
|
|
# daemon independently of Collection releases.
|
|
cloudflared_version: "2026.11.1"
|
|
cloudflared_sha256_amd64: "97bb3b02d23a5980fc9c15a1a270e692da1923f103f920d5b16d4931d5ab55e7"
|
|
cloudflared_download_url: "https://github.com/cloudflare/cloudflared/releases/download/{{ cloudflared_version }}/cloudflared-linux-amd64"
|
|
|
|
cloudflared_user: "cloudflared"
|
|
cloudflared_group: "cloudflared"
|
|
cloudflared_install_dir: "/usr/local/bin"
|
|
cloudflared_config_dir: "/etc/cloudflared"
|
|
cloudflared_service_unit: "/etc/systemd/system/cloudflared.service"
|
|
|
|
cloudflared_api_base_url: "https://api.cloudflare.com/client/v4"
|
|
|
|
cloudflared_tunnel_name: "{{ inventory_hostname }}-tunnel"
|
|
|
|
# Set false when the tunnel's DNS records are managed elsewhere: the role then makes no DNS
|
|
# call and needs no zone.
|
|
cloudflared_manage_dns: true
|
|
|
|
# Every zone differs, so there is no useful default; asserted non-empty while
|
|
# cloudflared_manage_dns is true.
|
|
cloudflared_zone_name: ""
|
|
|
|
# Hostnames routed through the tunnel; each gets a proxied CNAME while cloudflared_manage_dns
|
|
# is true. A catch-all http_status:404 rule is always appended.
|
|
cloudflared_ingress: []
|
|
|
|
# The role owns no firewall rule: the daemon only connects outbound to Cloudflare's edge.
|
|
|
|
# No default for cloudflared_tunnel_id, cloudflared_credentials_json, cloudflared_account_id or
|
|
# cloudflared_tunnel_api_token: they are secrets. The main entry point asserts them and, for the
|
|
# tunnel, names the mint entry point that creates it; the mint entry point creates a tunnel only
|
|
# while cloudflared_tunnel_id is undefined, null or empty.
|
|
|
|
# Hostnames from cloudflared_ingress whose existing DNS record may be overwritten although it does
|
|
# not point at a cfargotunnel.com tunnel. Without an entry the play fails instead. Per hostname, so
|
|
# unblocking one does not authorise overwriting the others.
|
|
cloudflared_allow_dns_overwrite: []
|
|
|
|
# Opt-in for the mint entry point.
|
|
cloudflared_mint_confirm: false
|