diff options
| author | Steven Dake <stdake@cisco.com> | 2016-04-05 11:32:20 -0400 |
|---|---|---|
| committer | Steven Dake <stdake@cisco.com> | 2016-04-05 12:02:01 -0400 |
| commit | ba4bcdbbe84a42e0346c0e36abf0d1cbc5007444 (patch) | |
| tree | cfe73f56ecaecff292ecf6cd31287a012b06198c /ansible | |
| parent | 2f4a3f35c00277cc97e887ba647395a702268e84 (diff) | |
| download | kolla-ba4bcdbbe84a42e0346c0e36abf0d1cbc5007444.tar.gz kolla-ba4bcdbbe84a42e0346c0e36abf0d1cbc5007444.zip | |
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
Diffstat (limited to 'ansible')
| -rw-r--r-- | ansible/roles/mariadb/tasks/start.yml | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/ansible/roles/mariadb/tasks/start.yml b/ansible/roles/mariadb/tasks/start.yml index 57313a918..2c4e955b0 100644 --- a/ansible/roles/mariadb/tasks/start.yml +++ b/ansible/roles/mariadb/tasks/start.yml @@ -14,12 +14,9 @@ ( delegate_host == 'None' and inventory_hostname != groups['mariadb'][0] ) - 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 + wait_for: + host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + port: "{{ mariadb_port }}" + connect_timeout: 1 + timeout: 60 + search_regex: "MariaDB" |
