damex.cloudflare.cloudflare_tunnels role – Ensure Cloudflare tunnels.

Note

This role 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_tunnels.

Entry point main – Ensure Cloudflare tunnels.

Synopsis

  • Ensure Cloudflare tunnels with ingress configuration.

Parameters

Parameter

Comments

cloudflare_tunnels

list / elements=dictionary / required

Tunnels to ensure.

account_api_key

string

Cloudflare account API key.

account_email

string

Cloudflare account email.

account_id

string

Cloudflare account identifier.

account_name

string

Cloudflare account name.

api_token

string

Cloudflare API token.

ingress

list / elements=dictionary

Ingress rules for the tunnel.

hostname

string

Hostname to match.

origin_request

dictionary

Origin request parameters.

service

string / required

Service URL or status code.

name

string / required

Tunnel name.

state

string

Tunnel state.

Choices:

  • "absent"

  • "present"

cloudflare_tunnels_account_api_key

string

Cloudflare account API key.

cloudflare_tunnels_account_email

string

Cloudflare account email.

cloudflare_tunnels_account_id

string

Cloudflare account identifier.

cloudflare_tunnels_account_name

string

Cloudflare account name.

cloudflare_tunnels_api_token

string

Cloudflare API token.

cloudflare_tunnels_state

string

Default tunnel state.

Choices:

  • "absent"

  • "present"

Examples

- name: Ensure cloudflare tunnels
  hosts: all
  tasks:
    - name: Ensure cloudflare tunnels
      ansible.builtin.import_role:
        name: damex.cloudflare.cloudflare_tunnels
      vars:
        cloudflare_tunnels_account_name: damex
        cloudflare_tunnels_api_token: "{{ cloudflare_api_token }}"
        cloudflare_tunnels:
          - name: hetzner
            ingress:
              - hostname: forgejo.damex.org
                service: http://localhost:3000
              - service: http_status:404