37 lines
957 B
YAML
37 lines
957 B
YAML
# 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]
|