diff --git a/group_vars/all b/group_vars/all index 43e780e4..a63f5c60 100644 --- a/group_vars/all +++ b/group_vars/all @@ -1,6 +1,7 @@ # General reset_files: false # Cleans up all CyMaIS files. It's necessary to run to whole playbook and not particial roles when using this function. verbose: false # Prints well formated debug information +database_delay: "0" # Database delay to wait for the central database before continue tasks top_domain: "localhost" # Change this in inventory to your domain ip4_address: "127.0.0.1" # Change thie in inventory to the ip address of your server backups_folder_path: "/Backups/" # Path to the backups folder diff --git a/roles/docker-mailu/tasks/main.yml b/roles/docker-mailu/tasks/main.yml index ac19de2d..945297e3 100644 --- a/roles/docker-mailu/tasks/main.yml +++ b/roles/docker-mailu/tasks/main.yml @@ -66,6 +66,14 @@ meta: flush_handlers when: setup | bool +- name: wait for database + wait_for: + host: 127.0.0.1 + port: "{{ http_port }}" + delay: "{{database_delay}}" + timeout: 300 + when: setup | bool + - name: execute database migration command: cmd: "docker compose -p mailu exec admin flask mailu admin admin {{top_domain}} {{mailu_initial_root_password}}" diff --git a/roles/docker-mariadb/tasks/main.yml b/roles/docker-mariadb/tasks/main.yml index 0802aa5d..327ab823 100644 --- a/roles/docker-mariadb/tasks/main.yml +++ b/roles/docker-mariadb/tasks/main.yml @@ -42,7 +42,7 @@ wait_for: host: 127.0.0.1 port: 3306 - delay: 10 + delay: "{{database_delay}}" timeout: 300 when: run_once_docker_mariadb is not defined diff --git a/roles/docker-postgres/tasks/main.yml b/roles/docker-postgres/tasks/main.yml index 76acf14f..98306096 100644 --- a/roles/docker-postgres/tasks/main.yml +++ b/roles/docker-postgres/tasks/main.yml @@ -31,7 +31,7 @@ wait_for: host: "127.0.0.1" port: "5432" - delay: 0 + delay: "{{database_delay}}" timeout: 300 when: run_once_docker_postgres is not defined