mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-12-08 10:26:35 +00:00
Solved CDN and Logout deployment bugs existing due to 2.18->2.20 update
This commit is contained in:
43
roles/sys-stk-front-proxy/tasks/01_core.yml
Normal file
43
roles/sys-stk-front-proxy/tasks/01_core.yml
Normal file
@@ -0,0 +1,43 @@
|
||||
- include_tasks: "{{ [ playbook_dir, 'tasks/utils/load_handlers.yml' ] | path_join }}"
|
||||
vars:
|
||||
handler_role_name: "svc-prx-openresty"
|
||||
|
||||
- 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: "{{ item }}"
|
||||
dest: "{{ front_proxy_domain_conf_dst }}"
|
||||
register: nginx_conf
|
||||
notify: restart openresty
|
||||
vars:
|
||||
nginx_template_candidates:
|
||||
- "{{ application_id | abs_role_path_by_application_id }}/templates/proxy.conf.j2"
|
||||
- "roles/sys-svc-proxy/templates/vhost/{{ vhost_flavour }}.conf.j2"
|
||||
with_first_found: "{{ nginx_template_candidates }}"
|
||||
|
||||
- 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
|
||||
Reference in New Issue
Block a user