Comment 8 for bug 1564278

Revision history for this message
Steven Dake (sdake) wrote : Re: mariadb.pid causes mariadb container from starting

This is the play:

- name: Waiting for MariaDB service to be ready
  command: "docker exec mariadb ls /var/lib/mysql/mariadb.pid"
  register: bootstrap_result
  when: delegate_host != 'None' or
        ( groups['mariadb'] | length ) == 1 or
        ( delegate_host == 'None' and inventory_hostname != groups['mariadb'][0] )
  until: bootstrap_result|success
  changed_when: False
  retries: 6
  delay: 10

I don't know if it is correct. Whatever the case is it looks flakey.

Another option for waiting for the MariaDB service to be ready is to use wait_for.

For example:
local_action: wait_for port="{{mariadb_port}}" host="{{notsurewhattoputhere}}" search_regex=MariaDB timeout=60