telekom-mms / ansible-collection-acme

An Ansible collection for issuing certificates via the ACME protocol.
GNU General Public License v3.0
49 stars 8 forks source link

Fix azure dns challenge bug #91

Closed avalor1 closed 1 year ago

avalor1 commented 1 year ago

If certificate is not due for renewal there is no challenge data but it still tried to create txt records and fails.

This PR fixes this behaviour.

rndmh3ro commented 1 year ago

There's now on all but one task the same when-condition challenge['challenge_data'][item] is defined set. What's with the last task? And could we move the conditions to one central place? Maybe to the include?

- name: Create challenge
  ansible.builtin.include_tasks: create-challenge.yml
avalor1 commented 1 year ago

One task right in the middle ("Let the challenge be validated...") does not have this condition thus we cannot use a block or move it to the include. This task does not need this condition as this makes it possible to retrieve a cert when it was already validated in another run but the challenge did not change during the current run.