How can I issue a Let's Encrypt certificate with Ansible when 'challenge_data' cannot be found?
This was caused by the fact that I was starting the Let's Encrypt challenges using a with_items loop. From here:


  When using register with a loop, the data structure placed in the variable during the loop will contain a results attribute, that is a list of all responses from the module. For a more in-depth example of how this works, see the Loops section on using register with a loop.


The solution is to have a separate task for each Let's Encrypt challenge, rather than having them all in one.