aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorforest <forest.n.johnson@gmail.com>2021-01-18 17:14:15 -0600
committerforest <forest.n.johnson@gmail.com>2021-01-18 17:14:15 -0600
commitcd6dc1c0af7d274bce0fa299b19793dc612a069d (patch)
tree72c7d56b668a734c88642ee4b57ea1bbf9cd3d03
parent86f93bd4792ca9b4629ce6c4a374c8e68f077d26 (diff)
downloadops-handbook-cd6dc1c0af7d274bce0fa299b19793dc612a069d.tar.gz
ops-handbook-cd6dc1c0af7d274bce0fa299b19793dc612a069d.tar.bz2
fix bug where hosts with no tls certificates configured would fail nginx
module oops, for real this time
-rw-r--r--ansible/roles/nginx/tasks/main.yml3
1 files changed, 2 insertions, 1 deletions
diff --git a/ansible/roles/nginx/tasks/main.yml b/ansible/roles/nginx/tasks/main.yml
index 5b5541a..aa81326 100644
--- a/ansible/roles/nginx/tasks/main.yml
+++ b/ansible/roles/nginx/tasks/main.yml
@@ -27,13 +27,14 @@
group: root
mode: 0644
register: tls_certs_list_file
+ when: tls_certs is defined
# this way invalid custom configs cant prevent nginx from starting, thus preventing uacme from running
- name: delete nginx custom configs if the tls_certs variable has changed
file:
path: /etc/nginx/conf.d
state: absent
- when: tls_certs_list_file.changed
+ when: tls_certs is defined and tls_certs_list_file.changed
- name: ensure /etc/nginx/conf.d exists
file: