damex.cloudflare.cloudflare_email_routing module – Ensure Cloudflare email routing

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_email_routing.

Synopsis

Parameters

Parameter

Comments

account_api_key

string

Cloudflare account API key.

Required together with account_email if api_token is not provided.

account_email

string

Cloudflare account email.

Required together with account_api_key if api_token is not provided.

api_token

string

Cloudflare API token.

Required if account_email and account_api_key are not provided.

Can be specified in CLOUDFLARE_TOKEN environment variable.

enabled

boolean / required

Email routing enabled state.

Choices:

  • false

  • true

zone_id

string

Zone identifier.

Required if zone_name is not provided.

zone_name

string

Zone domain name.

Required if zone_id is not provided.

Resolved to zone identifier via the Cloudflare API.

Attributes

Attribute

Support

Description

check_mode

Support: full

Supports check mode.

diff_mode

Support: full

Supports diff mode.

Examples

- name: Ensure email routing is enabled
  damex.cloudflare.cloudflare_email_routing:
    zone_name: example.com
    api_token: "{{ cloudflare_api_token }}"
    enabled: true

- name: Ensure email routing is disabled
  damex.cloudflare.cloudflare_email_routing:
    zone_id: 023e105f4ecef8ad9ca31a8372d0c353
    api_token: "{{ cloudflare_api_token }}"
    enabled: false

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

email_routing

dictionary

Email routing settings from the Cloudflare API.

Returned: success

enabled

boolean

Email routing enabled state.

Returned: success

id

string

Settings identifier.

Returned: success

name

string

Zone domain name.

Returned: success

status

string

Email routing status.

Returned: success

Sample: "ready"

Authors

  • Roman Kuzmitskii (@damex)