|
11 | 11 | records: |
12 | 12 | - entry: "{{ challenge['challenge_data'][item]['dns-01']['resource_value'] }}" |
13 | 13 | loop: "{{ acme_domain.subject_alt_name.top_level }}" |
14 | | - when: acme_domain.subject_alt_name.top_level is defined |
| 14 | + when: |
| 15 | + - acme_domain.subject_alt_name.top_level is defined |
| 16 | + # only runs if the challenge is run the first time, because then there is challenge_data |
| 17 | + - challenge['challenge_data'][item] is defined |
15 | 18 |
|
16 | 19 | # split second_level for zone_name and if subdomain is defined add subdomain to relative_name |
17 | 20 | - name: Add a new TXT record to the SAN second-level domains |
|
25 | 28 | records: |
26 | 29 | - entry: "{{ challenge['challenge_data'][item]['dns-01']['resource_value'] }}" |
27 | 30 | loop: "{{ acme_domain.subject_alt_name.second_level }}" |
28 | | - when: acme_domain.subject_alt_name.second_level is defined |
| 31 | + when: |
| 32 | + - acme_domain.subject_alt_name.second_level is defined |
| 33 | + # only runs if the challenge is run the first time, because then there is challenge_data |
| 34 | + - challenge['challenge_data'][item] is defined |
29 | 35 |
|
30 | 36 | - name: Let the challenge be validated and retrieve the cert and intermediate certificate |
31 | 37 | community.crypto.acme_certificate: |
|
54 | 60 | records: |
55 | 61 | - entry: "{{ challenge['challenge_data'][item]['dns-01']['resource_value'] }}" |
56 | 62 | loop: "{{ acme_domain.subject_alt_name.top_level }}" |
57 | | - when: acme_domain.subject_alt_name.top_level is defined |
| 63 | + when: |
| 64 | + - acme_domain.subject_alt_name.top_level is defined |
| 65 | + # only runs if the challenge is run the first time, because then there is challenge_data |
| 66 | + - challenge['challenge_data'][item] is defined |
58 | 67 |
|
59 | 68 | - name: Remove created SAN second-level TXT records to keep DNS zone clean |
60 | 69 | azure.azcollection.azure_rm_dnsrecordset: |
|
67 | 76 | records: |
68 | 77 | - entry: "{{ challenge['challenge_data'][item]['dns-01']['resource_value'] }}" |
69 | 78 | loop: "{{ acme_domain.subject_alt_name.second_level }}" |
70 | | - when: acme_domain.subject_alt_name.second_level is defined |
| 79 | + when: |
| 80 | + - acme_domain.subject_alt_name.second_level is defined |
| 81 | + # only runs if the challenge is run the first time, because then there is challenge_data |
| 82 | + - challenge['challenge_data'][item] is defined |
0 commit comments