add check for either certificate missing
This commit is contained in:
parent
d2fa8ab258
commit
799d8d3c6e
1 changed files with 10 additions and 2 deletions
|
@ -53,13 +53,21 @@
|
||||||
state: present
|
state: present
|
||||||
name: authnz_external
|
name: authnz_external
|
||||||
# Add DNS entries in OVH
|
# Add DNS entries in OVH
|
||||||
|
|
||||||
- name: Check if certificates exist
|
- name: Check if certificates exist
|
||||||
stat:
|
stat:
|
||||||
path: "/etc/letsencrypt/live/node-metrics-{{ ansible_fqdn }}/fullchain.pem"
|
path: "/etc/letsencrypt/live/node-metrics-{{ ansible_fqdn }}/fullchain.pem"
|
||||||
register: node_certificate
|
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
|
- name: Request certificates for node and postfix
|
||||||
include_tasks: configure_prometheus_exporters_certificates.yml
|
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
|
- name: Ensure virtual hosts configuration is deployed
|
||||||
template:
|
template:
|
||||||
src: templates/apache2.conf.j2
|
src: templates/apache2.conf.j2
|
||||||
|
|
Loading…
Reference in a new issue