mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Fix mysql authentication errors
The mysql-server package on Ubuntu16.04 was recently updated to disallow unauthenticated root user login over tcp/ip. This, coupled with pymysql using tcp/ip whenever host and port is specified causes us to fail to connect to the database when testing Python3 on Ubuntu16.04. The fix is to use the unix socket instead.
This commit is contained in:
@@ -37,6 +37,15 @@
|
||||
- 'default{{ python_suffix }}.yml'
|
||||
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
|
||||
yum: name={{ item }} state=latest
|
||||
with_items: "{{mysql_packages}}"
|
||||
|
||||
Reference in New Issue
Block a user