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: