Improved and simplified healthcheck. Use with --tags health to run.

This commit is contained in:
Jan Beilicke 2020-04-01 21:28:45 +02:00
parent df3d47bc9f
commit b375e7519a

View file

@ -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