I'm fairly new to this. I'm using ansible 2.9.6 on Ubuntu 20.04.

I followed the Digital Ocean tutorial 
<https://www.digitalocean.com/community/tutorials/how-to-acquire-a-let-s-encrypt-certificate-using-ansible-on-ubuntu-18-04>
 
to get started with letsencrypt/acme_certificate

The problem I run into is that if I run the play again, I get an error when 
I try to host the challenge data because challenge_data is an empty object.

I see in the official docs there is a "when" condition in the example:

when: sample_com_challenge is changed and 'sample.com' in 
sample_com_challenge['challenge_data']

...but I am unsure how to write this statement when the domain name comes 
from a variable. I tried both of the following:

when: acme_challenge_mydomain is changed and inventory_hostname in 
acme_challenge_mydomain['challenge_data']
and
when: acme_challenge_mydomain is changed and '{{ inventory_hostname }}' in 
acme_challenge_mydomain['challenge_data']
 
but in both cases the task executes even though I can see with a debug task 
that challenge_data is empty:
..."challenge_data": {},...


My second question is... I have remaining_days set to 91, and there are 89 
days left, so shouldn't I have data in challenge_data? The docs for 
remaining_days states "If cert_days < remaining_days, then it will be 
renewed. If the certificate is not renewed, module return values will not 
include challenge_data."

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6f8a97b2-05ae-4336-97e4-85213fa4b2ffn%40googlegroups.com.

Reply via email to