chore: complete update
This commit is contained in:
36
x_ansible/playbooks/deploy/includes/status_check.yml
Normal file
36
x_ansible/playbooks/deploy/includes/status_check.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
# Diese Datei enthält wiederverwendbare Tasks für die Anwendungsstatusüberprüfung
|
||||
|
||||
- name: Prüfe Anwendungsstatus
|
||||
uri:
|
||||
url: "http://{{ app_domain }}/"
|
||||
return_content: no
|
||||
status_code: 200, 301, 302, 403
|
||||
validate_certs: no
|
||||
timeout: 10
|
||||
register: app_status
|
||||
ignore_errors: yes
|
||||
delegate_to: localhost
|
||||
become: no
|
||||
tags: [check]
|
||||
|
||||
- name: Setze Standardwerte für app_status
|
||||
set_fact:
|
||||
app_status: { 'status': 'unbekannt' }
|
||||
when: app_status is undefined or app_status.status is undefined
|
||||
tags: [check]
|
||||
|
||||
- name: Zeige Anwendungsstatus
|
||||
debug:
|
||||
msg: >
|
||||
Anwendung ist
|
||||
{% if app_status.status is defined and app_status.status == 200 %}
|
||||
verfügbar
|
||||
{% else %}
|
||||
nicht verfügbar
|
||||
{% if app_status.status is defined %}
|
||||
(Status: {{ app_status.status }})
|
||||
{% else %}
|
||||
(Status konnte nicht ermittelt werden)
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
tags: [check]
|
||||
Reference in New Issue
Block a user