modernize, break out domains into vars files

This commit is contained in:
Josh Lay 2021-12-18 21:30:46 -06:00
parent 5a16d04975
commit 7e17cf6b41
4 changed files with 25 additions and 33 deletions

View file

@ -4,5 +4,17 @@
include_vars:
file: "~/.cloudflare.yml"
- include_tasks: zone.yml
loop: "{{ zones }}"
- 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')

View file

@ -1,15 +0,0 @@
---
- name: create records
cloudflare_dns:
zone: "{{ item.name }}"
record: "{{ record.name }}"
value: "{{ record.value }}"
type: "{{ record.type }}"
solo: yes
account_email: "{{ cf_email }}"
account_api_token: "{{ cf_token }}"
loop: "{{ item.records }}"
loop_control:
loop_var: record
when: (not item.state == 'absent')