diff --git a/mariadb.yml b/mariadb.yml index 5d89391..3de55c2 100644 --- a/mariadb.yml +++ b/mariadb.yml @@ -97,14 +97,14 @@ if [ -n "$new" ] then # start mariadb if not initialized and down - [ -s "db-data/mysql_upgrade_info" ] || docker compose up -d mariadb.{{inventory_hostname}} - # wait if mariadb is not finished while initializing - until [ -s "db-data/mysql_upgrade_info" ] - do - sleep 5 - done - sleep 10 - docker compose up -d --force-recreate + notinitilized="" + [ -s "db-data/mysql_upgrade_info" ] || notinitilized=1 + if [ -n "$notinitilized" ] + then + docker compose up -d mariadb.{{inventory_hostname}} + else + docker compose up -d --force-recreate mariadb.{{inventory_hostname}} + fi fi backup: yes