damex.cloudflare.cloudflare_pages_project module – Ensure Cloudflare Pages project
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_pages_project.
Synopsis
Ensures Cloudflare Pages projects with build configuration and custom domains, see the docs: https://developers.cloudflare.com/pages/.
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 |
|
Build command. |
|
Build output directory. |
|
Custom domains to assign to the project. |
|
Pages project name. |
|
Production branch name. Required when |
|
Project root directory. |
|
Project state. Choices:
|
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full |
Supports check mode. |
|
Support: full |
Supports diff mode. |
Examples
- name: Ensure Pages project
damex.cloudflare.cloudflare_pages_project:
name: my-docs
account_name: damex
api_token: "{{ cloudflare_api_token }}"
production_branch: production
build_command: make html
destination_directory: build/html
domains:
- docs.example.com
- name: Ensure Pages project is absent
damex.cloudflare.cloudflare_pages_project:
name: old-project
account_name: damex
api_token: "{{ cloudflare_api_token }}"
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Pages project object from the Cloudflare API. Returned: when state is present |
|
Custom domains. Returned: success |
|
Project name. Returned: success |
|
Production branch. Returned: success |
|
Pages subdomain. Returned: success |