refactor: replace srv-web-7-7-dns-records with sys-dns-cloudflare-records

- removed obsolete role `srv-web-7-7-dns-records` (README, meta, tasks)
- updated Gitea role to use `sys-dns-cloudflare-records` with explicit record vars
- updated web-opt-rdr-www role to use new DNS role with zone detection (`to_zone`)
- added REDIRECT_WWW_FLAVOR var to support "edge" flavor selection
This commit is contained in:
2025-08-16 23:52:46 +02:00
parent 1126765da2
commit bd2dde3af6
6 changed files with 25 additions and 91 deletions

View File

@@ -18,10 +18,21 @@
- name: Include DNS role to set redirects
include_role:
name: srv-web-7-7-dns-records
name: sys-dns-cloudflare-records
vars:
CLOUDFLARE_API_TOKEN: "{{ CLOUDFLARE_API_TOKEN }}"
cloudflare_domains: "{{ www_domains }}"
cloudflare_target_ip: "{{ networks.internet.ip4 }}"
cloudflare_proxied: false
cloudflare_records: |
{%- set bare = www_domains | map('regex_replace', '^www\\.(.+)$', '\\1') | list -%}
[
{%- for d in bare -%}
{
"type": "A",
"zone": "{{ d | to_zone }}",
"name": "{{ d }}",
"content": "{{ networks.internet.ip4 }}",
"proxied": false,
"ttl": 1
}{{ "," if not loop.last else "" }}
{%- endfor -%}
]
when: DNS_PROVIDER == 'cloudflare'