Improved and simplified healthcheck. Use with --tags health
to run.
This commit is contained in:
parent
df3d47bc9f
commit
b375e7519a
1 changed files with 5 additions and 13 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue