Ansible Role - Certbot (for Let's Encrypt)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible-role-certbot/tasks/generate-certs.yml

23 lines
689 B

---
- name: Make sure we have an email
assert:
that:
- "certbot_register_email != ''"
msg: "You need to provide an email address you own to register with Let's Encrypt."
- name: Make sure we have domains
assert:
that:
- "certbot_domains != []"
msg: "You need to provide at least one domain to generate certificates for."
- name: Register with Let's Encrypt
command: "{{ certbot_register_command }}"
args:
creates: /etc/letsencrypt/accounts
- name: Generate certificates
command: "{{ certbot_cert_command }} -d {{ certbot_domains | join(' -d ') }}"
register: result
changed_when: result.stdout.find("Certificate not yet due for renewal") == -1