mirror of
https://github.com/geerlingguy/ansible-role-certbot.git
synced 2025-07-12 01:11:34 +02:00
19 lines
618 B
YAML
19 lines
618 B
YAML
---
|
|
- name: Check if certificate already exists.
|
|
stat:
|
|
path: /etc/letsencrypt/live/{{ cert_item.domains | first }}/cert.pem
|
|
register: letsencrypt_cert_exists
|
|
|
|
- name: Check if certificate has changed.
|
|
lineinfile:
|
|
path: /etc/letsencrypt/domains-{{ cert_item.domains | first }}
|
|
line: "{{ cert_item.domains }}"
|
|
state: present
|
|
check_mode: yes
|
|
register: letsencrypt_cert_contents
|
|
when: letsencrypt_cert_exists.stat.exists
|
|
|
|
- set_fact:
|
|
letsencrypt_cert_updated: "{{ (letsencrypt_cert_contents | changed) or (letsencrypt_cert_contents | failed) }}"
|
|
when: letsencrypt_cert_exists.stat.exists
|