Comments (6)
I have to do this workaround:
file: mysql/tasks/users.yml
- name: MySQL | Make sure the MySQL users are present
mysql_user:
name: "{{item.name}}"
password: "{{item.pass | default('pass')}}"
priv: "{{item.priv | default('*.*:ALL')}}"
state: present
host: "{{item.host | default('localhost')}}"
with_items: mysql_users
when: mysql_users|length > 0
- name: Reset remote users password (this is a workaround)
shell: echo "UPDATE mysql.user SET password=PASSWORD('{{ mysql_root_password }}') WHERE host='%';" | mysql
- name: restart mysql (because handler don't work)
shell: service mysql restart
- name: Show hash password to compare
shell: echo "SELECT user, password FROM mysql.user WHERE host='%';" |mysql
from ansible-role-mysql.
@mnothic - Drupal VM uses a custom user/password to connect to MySQL locally, and I just tested on fresh CentOS 6, Ubuntu 12.04, and Ubuntu 14.04 VMs with this role and the following playbook:
---
- hosts: all
sudo: yes
vars:
mysql_users:
- name: geerling
host: '%'
password: 'secret'
priv: '*.*:ALL'
roles:
- geerlingguy.mysql
I was able to connect within the VM using mysql -u geerling -p
then entering the password. I tried a couple different combinations as well, and it had no issue.
I wonder if maybe the version of Ansible you're using is having trouble setting the password. I've been pinned to Ansible 1.9.0.1 since there are a couple other strange MySQL bugs with Ansible's MySQL module in 1.9.1 (which I believe are fixed in 1.9.2).
If you're still having this issue, can you please post what OS you're running, what version of MySQL you're running (mysql --version
), and what version of Ansible you're running on the host (ansible --version
)?
from ansible-role-mysql.
Use ansible 1.9.1 os used is Ubuntu 14.04.2 LT and mysql Ver 14.14 Distrib 5.5.43, for debian-linux-gnu (x86_64) using readline 6.
and this is not a drupalvm is a fresh install from 'ubuntu/trusty64' with vagrant
from ansible-role-mysql.
@mnothic - Can you try installing Ansible 1.9.0.1 instead to see if that fixes the issue? I have a feeling that this issue (and a few others that are cropping up) are related to some changes made in Ansible 1.9.1 and/or 1.9.2.
If you used pip to install Ansible, you can run:
sudo pip uninstall ansible
sudo pip install ansible==1.9.0.1
Then run the playbook again and see if the hashes/passwords are correct.
from ansible-role-mysql.
I'm still unable to reproduce when running Ansible 1.9.2 on Mac OS X to install on either Ubuntu 12/14, or CentOS 6/7... The only time I had any strange issues was when running 1.9.1 :(
from ansible-role-mysql.
OK Thanks I will upgrade it ASAP to test it.
from ansible-role-mysql.
Related Issues (20)
- MySQL fails to start when `mysql_datadir` is set to anything other than MySQL's default HOT 15
- Make apt update_cache optional or ignore errors HOT 2
- mysql_extra_config for my.cnf HOT 2
- force mariadb installation on ubuntu 22.04 not working HOT 1
- mysql_bind_address does not override all conf files
- FAILED! => {"changed": false, "msg": "Could not find the requested service mysql: host"} HOT 7
- secure-installation fails on RHEL8 at remove test database. HOT 3
- includedir is set only if mysql_config_include_files is set HOT 2
- error "couldn't resolve module/action 'mysql_user'" when i used in awx HOT 4
- add innodb settings HOT 2
- Warning "Option column_case_sensitive is not provided" during MySQL user setup HOT 3
- 'sudo mysql' allows access w/o password authentication after fresh install HOT 1
- root password with $ or % HOT 1
- Mysql role failing with empty hostname error HOT 1
- Update logrotate in Ubuntu for mysql.err
- Check master replication fails when running the cluster the first time HOT 3
- support for rocky linux or el
- make a distinction between mariadb and mysql
- Do not delete `ib_logfile0` on MariaDB 10.8.1 or higher HOT 2
- Installing user credentials file ~/.my.cnf should be optional
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-role-mysql.