mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 23:08:06 +02:00
Optimized cloudflare implementation
This commit is contained in:
18
roles/dns-records-cloudflare/tasks/main.yml
Normal file
18
roles/dns-records-cloudflare/tasks/main.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
- name: "Debug: cloudflare_domains"
|
||||
debug:
|
||||
var: cloudflare_domains
|
||||
when: enable_debug
|
||||
|
||||
- name: Create or update Cloudflare A-record for {{ item }}
|
||||
community.general.cloudflare_dns:
|
||||
api_token: "{{ cloudflare_api_token }}"
|
||||
zone: "{{ item.split('.')[-2:] | join('.') }}"
|
||||
state: present
|
||||
type: A
|
||||
name: "{{ item }}"
|
||||
content: "{{ cloudflare_target_ip }}"
|
||||
ttl: 1
|
||||
proxied: "{{ cloudflare_target_ip }}"
|
||||
loop: "{{ cloudflare_domains }}"
|
||||
loop_control:
|
||||
label: "{{ item }}"
|
Reference in New Issue
Block a user