Optimized cloudflare implementation

This commit is contained in:
2025-04-29 00:10:10 +02:00
parent 04deeef385
commit d796158c61
16 changed files with 151 additions and 48 deletions

View 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 }}"