What you have there should work, and this is one way to do it.
Alternatively, you can use the Jinja query to reduce it to 2 tasks, for example:
- name: Check certs exist
stat: path=/etc/letsencrypt/live/{{ rootDomain }}/fullchain.pem
register: st
- include: "{{ './_common/check-certs-renewable.yaml' if st.stat.exists else './_common/create-certs.yaml' }}"
However, it is more a matter of personal preference than anything else, and your path is more readable, so I will just stick to this IMHO.
source
share