mirror of
https://github.com/geerlingguy/ansible-role-certbot.git
synced 2025-04-19 17:01:37 +02:00
17 lines
489 B
YAML
17 lines
489 B
YAML
---
|
|
- name: Get installed certificates.
|
|
shell: |
|
|
{{ certbot_script }} certificates | grep "Domains:" | awk '{ gsub(/ Domains: /,""); print }'
|
|
changed_when: false
|
|
register: letsencrypt_certs
|
|
|
|
- name: Set cert_exists to false (to check if cert exists).
|
|
set_fact:
|
|
cert_exists: false
|
|
|
|
- name: Check if certificate already exists.
|
|
set_fact:
|
|
cert_exists: true
|
|
when: cert_item.domains | sort | difference(item) == []
|
|
with_list: "{{ letsencrypt_certs.stdout_lines }}"
|