forked from ccchb/ansible
22 lines
525 B
YAML
22 lines
525 B
YAML
---
|
|
- name: Enable certbot timer.
|
|
systemd:
|
|
name: certbot.timer
|
|
enabled: yes
|
|
|
|
- name: Install certbot.
|
|
package:
|
|
name: "{{ certbot_package }}"
|
|
state: present
|
|
|
|
- name: Check for presence of certificates.
|
|
stat:
|
|
path: "/etc/letsencrypt/live/{{ item | first | replace(\"*.\", \"\") }}/cert.pem"
|
|
register: certs_presence
|
|
loop: "{{ certbot_certs }}"
|
|
|
|
- name: Obtain certificates.
|
|
include_tasks: 'obtain_{{ certbot_method }}.yml'
|
|
when: not item.stat.exists
|
|
loop: "{{ certs_presence.results }}"
|
|
...
|