From 6d332231c60becd87165f695c9323d50f9296bc9 Mon Sep 17 00:00:00 2001 From: Lorenzo Date: Sun, 20 Nov 2016 18:33:52 +0100 Subject: [PATCH] disable broken server configuration files necessary to avoid nginx startup failure --- roles/nginx/tasks/main.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/roles/nginx/tasks/main.yaml b/roles/nginx/tasks/main.yaml index 1b1e633..a4d30ab 100644 --- a/roles/nginx/tasks/main.yaml +++ b/roles/nginx/tasks/main.yaml @@ -88,7 +88,17 @@ dest: "/etc/nginx/sites-available/{{ item.server.file_name }}" with_items: "{{ nginx_sites }}" when: nginx_sites is defined and nginx_sites + register: nginx_gen_conf notify: restart nginx + +- name: disable ssl configurations with pending cert issuing + file: + path: "/etc/nginx/sites-enabled/{{ item.item.server.file_name }}" + state: absent + with_items: "{{ nginx_gen_conf.results }}" + when: + - item | changed + - item.item.letsencrypt is defined - name: enable nginx configurations used for letsencrypt challenge file: