From b375e7519aebd252e2d3ea566cf8771d4aeeec8b Mon Sep 17 00:00:00 2001 From: Jan Beilicke Date: Wed, 1 Apr 2020 21:28:45 +0200 Subject: [PATCH] Improved and simplified healthcheck. Use with `--tags health` to run. --- tasks/main.yml | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index f6e766b..a3ae506 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -126,23 +126,15 @@ cmd: docker-compose exec -T -u www-data nextcloud-app /bin/bash -c './occ config:system:set overwritehost --value="{{ nextcloud_overwrite_host }}"' chdir: /home/{{ docker_user }}/nextcloud/ -- name: "Waiting for Nextcloud service (443/TLS) to become available" - become: false - wait_for: - host: "{{ ansible_ssh_host }}" - port: 443 - delegate_to: localhost - - name: "Test whether Nextcloud is healthy from the outside" become: false uri: - url: https://{{ nextcloud_virtual_host }} - return_content: yes + url: https://{{ nextcloud_virtual_host }}/login timeout: 300 validate_certs: no - register: url_check delegate_to: localhost + tags: health -- fail: - msg: 'Nextcloud homepage is not available!' - when: "'Nextcloud' not in url_check.content" +- debug: + var: url_check + tags: debug