Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mysql user module fails #21654

Closed
116davinder opened this issue Feb 20, 2017 · 1 comment
Closed

Mysql user module fails #21654

116davinder opened this issue Feb 20, 2017 · 1 comment
Labels
affects_2.2 This issue/PR affects Ansible v2.2 mysql

Comments

@116davinder
Copy link

116davinder commented Feb 20, 2017

ANSIBLE VERSION
root@grux:/home/grux/data_lake_nexa# ansible --version
ansible 2.2.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
OS / ENVIRONMENT
STEPS TO REPRODUCE
- name: Getting Mysql-Server Community RPM
  yum:
    name: http://repo.mysql.com//mysql57-community-release-el7-9.noarch.rpm
    state: present

- name: Getting GPG Key file Status
  stat:
    path: /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
  register: mysql_gpgkey

- name: Display facts known for Mysql gpgkey
  debug:
    var: mysql_gpgkey
    verbosity: 2

- name: Adding Mysql Server for yum Repository | {{ mysql_version }}
  yum_repository:
    name: "MySQL-Community-Server-{{ mysql_version }}"
    description: "MySQL Community Server {{ mysql_version }}"
    baseurl: "http://repo.mysql.com/yum/mysql-{{ mysql_version }}-community/el/6/$basearch/"
    enabled: yes
    gpgcheck: yes
    gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
  when:
    - mysql_gpgkey.stat.exists is defined

- name: Install MySQL-Server
  yum:
    name: "{{ item }}"
    state: present
  with_items:
    - mysql-community-server
    - MySQL-python

- name: Ensure mysql-server is running
  service:
    name: mysqld
    state: started
    enabled: true

- name: Getting MySql Temporary Password
  shell:  "grep 'temporary password' /var/log/mysqld.log | awk {'print $11'}"
  register: mysql_temp_password

- name: Display Mysql Temporary Root Password
  debug:
    var: "{{ mysql_temp_password.stdout }}"
    verbosity: 2

- set_fact:
    my_pass: "{{ mysql_temp_password.stdout }}"

- name: Deletes anonymous MySQL server user for localhost
  mysql_user:
    user: ""
    state: absent
    login_password: "{{ my_pass }}"
    login_user: root

RESULTS
TASK [mysql_standalone : Deletes anonymous MySQL server user for localhost] ****
task path: /home/grux/data_lake_nexa/roles/mysql_standalone/tasks/redhat.yml:67
fatal: [192.168.56.101]: FAILED! => {"changed": false, "failed": true, "msg": "unable to connect to database, check login_user and login_password are correct or /root/.my.cnf has the credentials. Exception message: (1862, 'Your password has expired. To log in you must change it using a client that supports expired passwords.')"}
@ansibot ansibot added affects_2.2 This issue/PR affects Ansible v2.2 needs_triage Needs a first human triage before being processed. labels Feb 20, 2017
@alikins
Copy link
Contributor

alikins commented Feb 20, 2017

This appears to be a user question, and we'd like to direct these kinds of things to either the mailing list or the IRC channel.

This allows us to keep the issue tracker for bugs, pull requests, RFEs and the like.

@alikins alikins closed this as completed Feb 20, 2017
@alikins alikins removed the needs_triage Needs a first human triage before being processed. label Feb 20, 2017
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.2 This issue/PR affects Ansible v2.2 mysql
Projects
None yet
Development

No branches or pull requests

4 participants