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 }}"'
|
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/
|
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"
|
- name: "Test whether Nextcloud is healthy from the outside"
|
||||||
become: false
|
become: false
|
||||||
uri:
|
uri:
|
||||||
url: https://{{ nextcloud_virtual_host }}
|
url: https://{{ nextcloud_virtual_host }}/login
|
||||||
return_content: yes
|
|
||||||
timeout: 300
|
timeout: 300
|
||||||
validate_certs: no
|
validate_certs: no
|
||||||
register: url_check
|
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
tags: health
|
||||||
|
|
||||||
- fail:
|
- debug:
|
||||||
msg: 'Nextcloud homepage is not available!'
|
var: url_check
|
||||||
when: "'Nextcloud' not in url_check.content"
|
tags: debug
|
||||||
|
|
Loading…
Add table
Reference in a new issue