mirror of
https://github.com/geerlingguy/ansible-role-certbot.git
synced 2025-04-19 17:01:37 +02:00
16 lines
510 B
YAML
16 lines
510 B
YAML
---
|
|
- name: Get installed certificates.
|
|
command: "{{ certbot_script }} certificates"
|
|
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 | select('match', '.*Domains:.*') | map('regex_replace', '^.*Domains: (.*)$', '\\1') }}"
|