Wait for Nextcloud database before installation

This commit is contained in:
Kris Lamoureux 2020-07-31 22:30:20 -04:00
parent b8623eba72
commit 066fc82a76
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925

View File

@ -38,6 +38,11 @@
traefik.docker.network: traefik traefik.docker.network: traefik
traefik.enable: "true" traefik.enable: "true"
- name: Grab Nextcloud database container information
docker_container_info:
name: "{{ nextcloud_dbcontainer }}"
register: nextcloud_dbinfo
- name: Grab Nextcloud container information - name: Grab Nextcloud container information
docker_container_info: docker_container_info:
name: "{{ nextcloud_container }}" name: "{{ nextcloud_container }}"
@ -55,6 +60,11 @@
args: args:
removes: "{{ nextcloud_root }}/config/CAN_INSTALL" removes: "{{ nextcloud_root }}/config/CAN_INSTALL"
- name: Wait for Nextcloud database to become available
wait_for:
host: "{{ nextcloud_dbinfo.container.NetworkSettings.Networks.nextcloud.IPAddress }}"
port: 3306
- name: Install Nextcloud - name: Install Nextcloud
command: 'docker exec --user www-data {{ nextcloud_container }} command: 'docker exec --user www-data {{ nextcloud_container }}
php occ maintenance:install php occ maintenance:install