damex.cloudflare.cloudflare_pages_projects role – Ensure Cloudflare Pages projects.

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

Entry point main – Ensure Cloudflare Pages projects.

Synopsis

  • Ensure Cloudflare Pages projects with build configuration and custom domains.

Parameters

Parameter

Comments

cloudflare_pages_projects

list / elements=dictionary / required

Pages projects 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.

build_command

string

Build command.

destination_directory

string

Build output directory.

domains

list / elements=string

Custom domains.

name

string / required

Project name.

production_branch

string

Production branch name.

root_directory

string

Project root directory.

state

string

Project state.

Choices:

  • "absent"

  • "present"

cloudflare_pages_projects_account_api_key

string

Cloudflare account API key.

cloudflare_pages_projects_account_email

string

Cloudflare account email.

cloudflare_pages_projects_account_id

string

Cloudflare account identifier.

cloudflare_pages_projects_account_name

string

Cloudflare account name.

cloudflare_pages_projects_api_token

string

Cloudflare API token.

cloudflare_pages_projects_state

string

Default project state.

Choices:

  • "absent"

  • "present"

Examples

- name: Ensure cloudflare Pages projects
  hosts: all
  tasks:
    - name: Ensure cloudflare Pages projects
      ansible.builtin.import_role:
        name: damex.cloudflare.cloudflare_pages_projects
      vars:
        cloudflare_pages_projects_account_name: damex
        cloudflare_pages_projects_api_token: "{{ cloudflare_api_token }}"
        cloudflare_pages_projects:
          - name: my-docs
            production_branch: production
            domains:
              - docs.example.com