20 lines
495 B
YAML
20 lines
495 B
YAML
---
|
|
|
|
- name: import cloudflare creds
|
|
include_vars:
|
|
file: "~/.cloudflare.yml"
|
|
|
|
- name: "create records ({{domain}})"
|
|
cloudflare_dns:
|
|
zone: "{{ domain }}"
|
|
record: "{{ record.name }}"
|
|
value: "{{ record.value }}"
|
|
type: "{{ record.type }}"
|
|
solo: yes
|
|
state: present
|
|
account_email: "{{ cf_email }}"
|
|
account_api_token: "{{ cf_token }}"
|
|
loop: "{{ records }}"
|
|
loop_control:
|
|
loop_var: record
|
|
when: (item.state is undefined) or (not item.state == 'absent')
|