add check for either certificate missing

This commit is contained in:
Antonio J. Delgado 2023-01-28 00:51:14 +02:00
parent d2fa8ab258
commit 799d8d3c6e

View file

@ -53,13 +53,21 @@
state: present
name: authnz_external
# Add DNS entries in OVH
- name: Check if certificates exist
stat:
path: "/etc/letsencrypt/live/node-metrics-{{ ansible_fqdn }}/fullchain.pem"
register: node_certificate
- name: Check if postfix certificates exist
stat:
path: "/etc/letsencrypt/live/postfix-metrics-{{ ansible_fqdn }}/fullchain.pem"
register: postfix_certificate
- name: Request certificates for node and postfix
include_tasks: configure_prometheus_exporters_certificates.yml
when: not node_certificate.stat.exists
when: not node_certificate.stat.exists or not postfix_certificate.stat.exists
- name: Ensure virtual hosts configuration is deployed
template:
src: templates/apache2.conf.j2