damex.cloudflare.cloudflare_tunnel_info module – Ensure Cloudflare tunnel information is gathered
Note
This module is part of the damex.cloudflare collection (version 1.2.3).
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install damex.cloudflare.
To use it in a playbook, specify: damex.cloudflare.cloudflare_tunnel_info.
Synopsis
Gathers Cloudflare tunnel information including the run token.
See the docs: https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/.
Parameters
Parameter |
Comments |
|---|---|
Cloudflare account API key. Required together with |
|
Cloudflare account email. Required together with |
|
Cloudflare account identifier. Required if |
|
Cloudflare account name. Required if Resolved to account identifier via the Cloudflare API. |
|
Cloudflare API token. Required if Can be specified in |
|
Tunnel name to query. If not specified, all tunnels are returned. |
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full |
Supports check mode. |
|
Support: none |
Does not support diff mode. |
Examples
- name: Ensure tunnel facts are gathered
damex.cloudflare.cloudflare_tunnel_info:
name: hetzner
account_name: damex
api_token: "{{ cloudflare_api_token }}"
register: cloudflare_tunnel_state
- name: Ensure cloudflared service
ansible.builtin.template:
src: cloudflared.service.j2
dest: /etc/systemd/system/cloudflared.service
vars:
cloudflared_token: "{{ cloudflare_tunnel_state.tunnel.token }}"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Tunnel information. Returned: always |
|
Tunnel unique identifier. Returned: always |
|
Current ingress rules. Returned: when querying a specific tunnel |
|
Tunnel display name. Returned: always |
|
Tunnel connection status. Returned: always |
|
Tunnel authentication token for cloudflared. Returned: when querying a specific tunnel |