An Ansible collection of Cloudflare modules, plugins, and roles.
See requirements.yml.
ansible-galaxy collection install linuxhq.cloudflareLocal Tox environments use the Python version selected by .python-version.
With Tox installed, install the pre-commit hook:
tox run -e pre-commitTox manages isolated environments under .tox/; no environment activation is required.
Run the default checks:
toxRun grouped checks:
tox run -m format
tox run -m lint
tox run -m unitRun Ansible sanity tests for a module:
tox run -e ansible-test -- sanity plugins/modules/access_apps.pyEach role has a Molecule scenario that also serves as an example playbook. Set MOLECULE_ROLE
to select a role:
MOLECULE_ROLE=accounts_info tox run -e molecule -- test -s defaultMolecule scenarios may create real Cloudflare resources.
tox run -e changelog -- generate
tox run -e buildExample playbooks and inventory are available in examples/.
These roles require an API token created from the Cloudflare dashboard.
Using every role in the collection requires the following permissions:
| Type | Permission | Value |
|---|---|---|
| Account | Access: Apps and Policies | Write |
| Account | Access: Organizations, Identity Providers, and Groups | Write |
| Account | Access: Service Tokens | Write |
| Account | Account Filter Lists | Edit |
| Account | Account Settings | Read |
| Account | Account WAF | Write |
| Account | Cloudflare Pages | Write |
| Account | Cloudflare Tunnel | Write |
| Account | Cloudflare One Connector: WARP | Write |
| Account | Zero Trust | Write |
| Zone | Cache Purge | Purge |
| Zone | DNS | Write |
| Zone | Page Rules | Write |
| Zone | Zone | Write |