Add DNS records to Cloudflare automatically

This replaces the custom solution where the records were
added manually in pi-hole.
This commit is contained in:
Thomas Kleinendorst 2024-12-25 17:23:35 +01:00
parent de2b39097a
commit 1969af9a01
2 changed files with 24 additions and 20 deletions

View file

@ -11,8 +11,10 @@
dest: "/etc/nginx/conf.d/{{ simple_reverse_proxy_internal_subdomain }}.conf" dest: "/etc/nginx/conf.d/{{ simple_reverse_proxy_internal_subdomain }}.conf"
mode: '0644' mode: '0644'
notify: Restart Nginx notify: Restart Nginx
- name: Debug - name: Add DNS record in Cloudflare
ansible.builtin.debug: community.general.cloudflare_dns:
msg: >- domain: kleinendorst.info
Don't forget to manually add a DNS record for {{ simple_reverse_proxy_internal_subdomain }}.kleinendorst.info record: "{{ simple_reverse_proxy_internal_subdomain }}"
pointing to: {{ ansible_facts['default_ipv4']['address'] }}. type: A
value: "{{ ansible_facts['default_ipv4']['address'] }}"
api_token: "{{ dns_cloudflare_token }}"

View file

@ -1,16 +1,18 @@
$ANSIBLE_VAULT;1.1;AES256 $ANSIBLE_VAULT;1.1;AES256
30373364386562346336393739366135656330636265663335366166373730383561356633323434 65323465313539616564316534353439633262633863316361613032363035663834663936333633
6363643165643435303563363735313532393130363761620a353535386235333938653739353362 3662626332313834353464396461653062356665373537310a643932323737646439376335616638
37623765346234363336343261313637386361383765616534323131313230323832616331643835 34313464383138303332386261346635663162663966313361383465363261663930376262663737
3865653536666533320a616137323464336233393638646166306463616234653434663037393165 3138623038643066640a393966333763366165396462393736633633353763326265393231623831
35393337326435653131626230333261666138353931616664646133333061633937313339323261 30376537306136376462656263336638656666636132306561656634663362393361636162313538
62373436363234653837383339613237383530396336383235313537363061653365346234383335 64343063613935303066656265356636376539366166636362353236616633366165663062353232
66346438353535373635663463393366616534346463333365353031323638346562323138333261 37623362323737303537323363386630383062356235336464643734396533353563333161333261
65663134313735313331613032336462383131666364303834343137613061343138366338376566 33383663316165656461303263376639303939663231336133373432373064663865396436643963
64373034616439646265323262323563343132623166336235346439356663633538613639643435 30643265313033356362663930373632386330353162646562383835623730316534396236353230
32313939343134646330653162363538643466656432643737353163653230663665346131363534 31386161306433393663353764643636336565666435626164353861626365396339333962636337
39356164383262353562383633633834326161343737616439313064626432346562346363653666 38383865383130383035623330313435656435633137316461383365373365343031313930343133
32643636353662373665353539313833626364653231323233623961303137383038336136326138 63323739383637383263386663326436343938396432353163343738666366613037653434393262
38363030393430346164653964656665636464666662353130633132313066373338303631343733 35666332383239323134643738383139316565323337613135653538336433373130343339306539
38613230363532306364353164346537353965626161633230343138376639343864316436613039 32353662636334323130646134306434636339396239643234613261626365393138303431393866
643233623535616638333630373031313561 61353832663135636334343334613135393661326336666332316236366236353037326465636462
31633133326431653837653634343934366662313831303263656462663334643165666138343766
35376631656236613036616431346163313434613465303066323961323532373136