Skip to content

Commit

Permalink
Update after feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Kluge committed Feb 14, 2025
1 parent 5ea3533 commit 13d7f59
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions roles/acme/tasks/challenge/dns-01/nsupdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
when: acme_challenge is changed
connection: local
delegate_to: localhost
vars:
relevant_domains: "{{ ([acme_domain.certificate_name] + acme_domain.subject_alt_name | default([])) | ansible.builtin.unique }}"
block:
- name: Add a new TXT record to the relevant domains (main and SAN)
vars:
Expand All @@ -21,10 +19,14 @@
value: "{{ record_data }}"
type: "TXT"
ttl: "120"
loop: "{{ relevant_domains }}"
loop: "{{ acme_domain.subject_alt_name }}"
loop_control:
label: "zone={{ domain }} rr={{ record_name }} (TXT) {{ record_data }}"
loop_var: "domain"
when:
- acme_domain.subject_alt_name is defined
# only runs if the challenge is run the first time, because then there is challenge_data
- acme_challenge['challenge_data'][domain] is defined

- name: Wait for DNS replication to catch up
ansible.builtin.pause:
Expand Down Expand Up @@ -64,7 +66,11 @@
type: "TXT"
ttl: "120"
state: absent
loop: "{{ relevant_domains }}"
loop: "{{ acme_domain.subject_alt_name }}"
loop_control:
label: "zone={{ domain }} rr={{ record_name }} (TXT) {{ record_data }}"
loop_var: "domain"
when:
- acme_domain.subject_alt_name is defined
# only runs if the challenge is run the first time, because then there is challenge_data
- acme_challenge['challenge_data'][domain] is defined

Check failure on line 76 in roles/acme/tasks/challenge/dns-01/nsupdate.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

yaml[new-line-at-end-of-file]

No new line character at the end of file

0 comments on commit 13d7f59

Please sign in to comment.