Add checks for when the challenge isn't changed
This commit is contained in:
parent
2f2313d401
commit
af3c5d696f
1 changed files with 3 additions and 0 deletions
|
@ -76,6 +76,7 @@
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "/var/www/acme/{{ letsencrypt_challenge['challenge_data']['tunuifranken.info']['http-01']['resource'] }}"
|
path: "/var/www/acme/{{ letsencrypt_challenge['challenge_data']['tunuifranken.info']['http-01']['resource'] }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
when: letsencrypt_challenge is changed and 'tunuifranken.info' in letsencrypt_challenge.challenge_data
|
||||||
|
|
||||||
- name: Do dns-01 challenge
|
- name: Do dns-01 challenge
|
||||||
become: true
|
become: true
|
||||||
|
@ -106,6 +107,7 @@
|
||||||
- name: Wait for DNS to propagate
|
- name: Wait for DNS to propagate
|
||||||
ansible.builtin.pause:
|
ansible.builtin.pause:
|
||||||
seconds: 300
|
seconds: 300
|
||||||
|
when: letsencrypt_challenge is changed and 'tunuifranken.info' in letsencrypt_challenge.challenge_data
|
||||||
- name: Validate the challenge and get the cert
|
- name: Validate the challenge and get the cert
|
||||||
community.crypto.acme_certificate:
|
community.crypto.acme_certificate:
|
||||||
acme_version: 2
|
acme_version: 2
|
||||||
|
@ -124,3 +126,4 @@
|
||||||
record: "{{ letsencrypt_challenge.challenge_data['tunuifranken.info']['dns-01'].resource }}"
|
record: "{{ letsencrypt_challenge.challenge_data['tunuifranken.info']['dns-01'].resource }}"
|
||||||
type: TXT
|
type: TXT
|
||||||
state: absent
|
state: absent
|
||||||
|
when: letsencrypt_challenge is changed and 'tunuifranken.info' in letsencrypt_challenge.challenge_data
|
||||||
|
|
Loading…
Reference in a new issue