mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-15 08:30:46 +02:00
Optimized blocks in roles/srv-proxy-6-6-domain/tasks/main.yml
This commit is contained in:
parent
77816ac4e7
commit
f5659a44f8
@ -1,7 +1,6 @@
|
||||
# run_once_srv_proxy_6_6_domain: deactivated
|
||||
|
||||
- block:
|
||||
- include_tasks: "01_cloudflare.yml"
|
||||
- include_tasks: "01_cloudflare.yml"
|
||||
when: dns_provider == "cloudflare"
|
||||
|
||||
- include_tasks: "{{ playbook_dir }}/tasks/utils/load_handlers.yml"
|
||||
@ -19,19 +18,19 @@
|
||||
register: nginx_conf
|
||||
notify: restart openresty
|
||||
|
||||
- name: "Check if {{ domains | get_domain(application_id) }} is reachable (only if config unchanged)"
|
||||
- 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
|
||||
when: not nginx_conf.changed
|
||||
|
||||
- name: Restart nginx if site is down
|
||||
- name: Restart nginx if site is down
|
||||
command:
|
||||
cmd: "true"
|
||||
notify: restart openresty
|
||||
when:
|
||||
- not nginx_conf.changed
|
||||
- site_check.status is defined
|
||||
- not site_check.status in [200,301,302]
|
||||
when: not nginx_conf.changed
|
Loading…
x
Reference in New Issue
Block a user