3
0
mirror of https://github.com/spantaleev/matrix-docker-ansible-deploy.git synced 2026-01-19 06:15:18 +00:00

Add self-check command

This commit is contained in:
Slavi Pantaleev
2018-10-21 12:58:25 +03:00
parent b215cc05fb
commit d0c2ef10e4
14 changed files with 224 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
---
- set_fact:
riot_web_url_endpoint_public: "https://{{ hostname_riot }}/config.json"
- name: Check riot-web
uri:
url: "{{ riot_web_url_endpoint_public }}"
follow_redirects: false
register: result_riot_web
ignore_errors: true
- name: Fail if riot-web not working
fail:
msg: "Failed checking riot-web is up at `{{ hostname_riot }}` (checked endpoint: `{{ riot_web_url_endpoint_public }}`). Is Riot running? Is port 443 open in your firewall? Full error: {{ result_riot_web }}"
when: "result_riot_web.failed or 'json' not in result_riot_web"
- name: Report working riot-web
debug:
msg: "riot-web at `{{ hostname_riot }}` is working (checked endpoint: `{{ riot_web_url_endpoint_public }}`)"