From df3d47bc9f9aa843350cbe845b6b07de3aca29a0 Mon Sep 17 00:00:00 2001 From: Jan Beilicke Date: Sun, 29 Mar 2020 15:32:45 +0200 Subject: [PATCH] Added final health check to ensure availability of Nextcloud from the outside --- tasks/main.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 2a55c6f..f6e766b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -133,10 +133,16 @@ port: 443 delegate_to: localhost -# - name: "Testing whether the Nextcloud homepage is available#" -# action: uri url=http://{{ ansible_ssh_host }} return_content=yes -# register: gl +- name: "Test whether Nextcloud is healthy from the outside" + become: false + uri: + url: https://{{ nextcloud_virtual_host }} + return_content: yes + timeout: 300 + validate_certs: no + register: url_check + delegate_to: localhost -# - fail: -# msg: 'Graylog homepage is not available!' -# when: "'Graylog Web Interface' not in gl.content" +- fail: + msg: 'Nextcloud homepage is not available!' + when: "'Nextcloud' not in url_check.content"