Change waiting on mariadb.pid

Previously the code looked at mariadb.pid, but this seemed
flakey in function.  It seemed racey and prone to failure on
slower connections to a registry.  The original task was
extremely complex and it didnt really verify that the MariaDB
was ready to serve connections.  Use wait_for with a regex
instead.

Change-Id: I3aafac04f03639b08e0ef4d6a9c9e1a4499f000c
Closes-Bug: #1564278
This commit is contained in:
Steven Dake 2016-04-05 11:32:20 -04:00
parent 2f4a3f35c0
commit ba4bcdbbe8

View File

@ -14,12 +14,9 @@
( delegate_host == 'None' and inventory_hostname != groups['mariadb'][0] ) ( delegate_host == 'None' and inventory_hostname != groups['mariadb'][0] )
- name: Waiting for MariaDB service to be ready - name: Waiting for MariaDB service to be ready
command: "docker exec mariadb ls /var/lib/mysql/mariadb.pid" wait_for:
register: bootstrap_result host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
when: delegate_host != 'None' or port: "{{ mariadb_port }}"
( groups['mariadb'] | length ) == 1 or connect_timeout: 1
( delegate_host == 'None' and inventory_hostname != groups['mariadb'][0] ) timeout: 60
until: bootstrap_result|success search_regex: "MariaDB"
changed_when: False
retries: 6
delay: 10