[stable-2.7] Detect the socket path after starting the service. Fixes #47582

(cherry picked from commit 10e129e)

Co-authored-by: Matt Martz <matt@sivel.net>
This commit is contained in:
Matt Martz 2018-10-25 12:25:02 -05:00 committed by Toshio Kuratomi
parent c5df4c538d
commit c901f2c3c4

View file

@ -37,15 +37,6 @@
- 'default{{ python_suffix }}.yml' - 'default{{ python_suffix }}.yml'
paths: '../vars' paths: '../vars'
- name: Detect socket path
shell: >
echo "show variables like 'socket'\G" | mysql | grep 'Value: ' | sed 's/[ ]\+Value: //'
register: _socket_path
- name: Set socket path
set_fact:
mysql_socket: '{{ _socket_path["stdout"] }}'
- name: install mysqldb_test rpm dependencies - name: install mysqldb_test rpm dependencies
yum: name={{ item }} state=latest yum: name={{ item }} state=latest
with_items: "{{mysql_packages}}" with_items: "{{mysql_packages}}"
@ -82,3 +73,12 @@
- name: start mysql_db service if not running - name: start mysql_db service if not running
service: name={{ mysql_service }} state=started service: name={{ mysql_service }} state=started
- name: Detect socket path
shell: >
echo "show variables like 'socket'\G" | mysql | grep 'Value: ' | sed 's/[ ]\+Value: //'
register: _socket_path
- name: Set socket path
set_fact:
mysql_socket: '{{ _socket_path["stdout"] }}'