I am writing a template in which the warning output is generated if the winRM certificate of target windows host is going to expire in 1 month. I just don’t see a way how can i compare two dates in jinja2 template.
I have the winrm certificate expiration time in the fact - ansible_winrm_certificate_expires
Now the comparison will look something like this in template:
Check WinRM certificate
{% for i in play_hosts %}
{% if hostvars[i].ansible_winrm_certificate_expires compared to current date %}
{{ i }}: Warning - WinRM certificate expires in 1 month
{% endif %}
{% endfor %}
Any way of comparing dates here ?