GithubHelp home page GithubHelp logo

Comments (6)

mnothic avatar mnothic commented on August 29, 2024

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.

geerlingguy avatar geerlingguy commented on August 29, 2024

@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.

mnothic avatar mnothic commented on August 29, 2024

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.

geerlingguy avatar geerlingguy commented on August 29, 2024

@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.

geerlingguy avatar geerlingguy commented on August 29, 2024

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.

mnothic avatar mnothic commented on August 29, 2024

OK Thanks I will upgrade it ASAP to test it.

from ansible-role-mysql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.