apache2: Fix certificate existence check

This commit is contained in:
s3lph 2021-04-26 00:57:30 +02:00
parent 09a8ad12c2
commit ce69c49464

View file

@ -33,8 +33,8 @@
vars:
name: "{{ item.key }}"
site: "{{ item.value }}"
certfile_exists: "{{ (apache2_register_stat_tls_keypairs.results | selectattr('item', 'equalto', (item.value.tls_certfile | default(apache2_tls_certfile)) )).stat.exists }}"
keyfile_exists: "{{ (apache2_register_stat_tls_keypairs.results | selectattr('item', 'equalto', (item.value.tls_certfile | default(apache2_tls_keyfile)) )).stat.exists }}"
certfile_exists: "{{ (apache2_register_stat_tls_keypairs.results | selectattr('item', 'equalto', (item.value.tls_certfile | default(apache2_tls_certfile)) ))[0].stat.exists }}"
keyfile_exists: "{{ (apache2_register_stat_tls_keypairs.results | selectattr('item', 'equalto', (item.value.tls_certfile | default(apache2_tls_keyfile)) ))[0].stat.exists }}"
loop: "{{ apache2_sites | dict2items }}"
notify: reload apache2