init
This commit is contained in:
commit
5a16d04975
6 changed files with 60 additions and 0 deletions
14
roles/create-records/defaults/main.yml
Normal file
14
roles/create-records/defaults/main.yml
Normal file
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
zones:
|
||||
- name: jlay.dev
|
||||
state: present
|
||||
records:
|
||||
- name: git.ry1
|
||||
value: "107.181.235.67"
|
||||
type: A
|
||||
- name: ry1
|
||||
value: "107.181.235.66"
|
||||
type: A
|
||||
- name: ry2
|
||||
value: "107.181.235.74"
|
||||
type: A
|
8
roles/create-records/tasks/main.yml
Normal file
8
roles/create-records/tasks/main.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
|
||||
- name: import cloudflare creds
|
||||
include_vars:
|
||||
file: "~/.cloudflare.yml"
|
||||
|
||||
- include_tasks: zone.yml
|
||||
loop: "{{ zones }}"
|
15
roles/create-records/tasks/zone.yml
Normal file
15
roles/create-records/tasks/zone.yml
Normal file
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
|
||||
- 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')
|
Loading…
Add table
Add a link
Reference in a new issue