Sample Ansible role to create CloudFlare DNS records
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Josh Lay 8789c9d594
support record removal
10 months ago
roles/manage-records correct TLD in comment 10 months ago
.gitignore init 3 years ago
README.md support record removal 10 months ago
ansible.cfg fix fact gathering, rename role 10 months ago
domains move record state to vars, support removal 10 months ago
play.yml fix fact gathering, rename role 10 months ago

README.md

cfdns

Sample Ansible role to create/remove CloudFlare DNS records

Requirements

  1. See roles/create-records/vars/sample.yml for sample DNS zone entry definitions -- change these as desired

To add a domain, define it in the domains list in play.yml.

This will load the correlating file at roles/create-records/vars/{{domain}}.yml.

The symbolic link ./domains was provided to make these files more accessible, not used for function -- can be removed.

TODO: Load files created here dynamically

  1. Your CloudFlare email address and API key must be stored in ~/.cloudflare.yml like so for authentication:
---
cf_email: you@domain.com
cf_token: abcdef123456

If this is a shared system, chmod -v 0600 ~/.cloudflare.yml once created to avoid potentially leaking credentials.