- name: Front bootstrap include_role: name: sys-stk-front-base - name: "include role for '{{ domain }}' to receive certificates and do the modification routines" include_role: name: sys-util-csp-cert - name: "Copy nginx config to '{{ front_proxy_domain_conf_dst }}'" template: src: "{{ front_proxy_domain_conf_src }}" dest: "{{ front_proxy_domain_conf_dst }}" register: nginx_conf notify: restart openresty - block: - name: "Check if {{ domains | get_domain(application_id) }} is reachable (only if config unchanged)" uri: url: "{{ domains | get_url(application_id, WEB_PROTOCOL) }}" register: site_check failed_when: false changed_when: false - name: Restart nginx if site is down command: cmd: "true" notify: restart openresty when: - site_check.status is defined - not site_check.status in [200,301,302] when: not nginx_conf.changed - name: "Restart Webserver for '{{ front_proxy_domain_conf_dst }}'" meta: flush_handlers