diff --git a/tasks/configure_prometheus_exporters_external.yml b/tasks/configure_prometheus_exporters_external.yml index b8bbf47..65f7999 100644 --- a/tasks/configure_prometheus_exporters_external.yml +++ b/tasks/configure_prometheus_exporters_external.yml @@ -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 @@ -74,4 +82,4 @@ - name: Start Apache2 after request certificate service: name: apache2 - state: started \ No newline at end of file + state: started