From 066fc82a76e22d5b0acdbd66b310e2afa79ab7f6 Mon Sep 17 00:00:00 2001 From: Kris Lamoureux Date: Fri, 31 Jul 2020 22:30:20 -0400 Subject: [PATCH] Wait for Nextcloud database before installation --- roles/nextcloud/tasks/main.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/roles/nextcloud/tasks/main.yml b/roles/nextcloud/tasks/main.yml index fd9f870..15d8255 100644 --- a/roles/nextcloud/tasks/main.yml +++ b/roles/nextcloud/tasks/main.yml @@ -38,6 +38,11 @@ traefik.docker.network: traefik traefik.enable: "true" +- name: Grab Nextcloud database container information + docker_container_info: + name: "{{ nextcloud_dbcontainer }}" + register: nextcloud_dbinfo + - name: Grab Nextcloud container information docker_container_info: name: "{{ nextcloud_container }}" @@ -55,6 +60,11 @@ args: 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 command: 'docker exec --user www-data {{ nextcloud_container }} php occ maintenance:install