diff --git a/mariadb.yml b/mariadb.yml index 4d6fe02..1f3e588 100644 --- a/mariadb.yml +++ b/mariadb.yml @@ -63,6 +63,12 @@ if [ -n "$notinitilized" ] then docker compose up -d mariadb.{{inventory_hostname}} + # get sure mariadb is ready with initializing + until [ -s "db-data/mysql_upgrade_info" ] + do + sleep 5 + done + sleep 120 else docker compose up -d --force-recreate mariadb.{{inventory_hostname}} fi @@ -99,7 +105,7 @@ mode: 0444 owner: root group: docker - marker: "# {mark} ANSIBLE MANAGED BLOCK" + marker: "// {mark} ANSIBLE MANAGED BLOCK" block: | // IP address / host of your instance $cfg['Servers'][$i]['host'] = 'mariadb.{{inventory_hostname}}'; @@ -179,7 +185,7 @@ external: true backup: yes - #notify: Restart mariadb + notify: Restart mariadb - name: Get letsencrypt cert from traefik ansible.builtin.shell: /usr/local/sbin/autoupdate.d/mariadb-ssl.update @@ -189,8 +195,8 @@ handlers: - #- name: Restart mariadb - # ansible.builtin.shell: docker-compose up -d --force-recreate - # args: - # chdir: /home/docker/mariadb.{{inventory_hostname}} + - name: Restart mariadb + ansible.builtin.shell: docker-compose up -d --force-recreate + args: + chdir: /home/docker/mariadb.{{inventory_hostname}}