Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {"failed": true, "invocation": {"module_args":
- {"append_privs": false, "check_implicit_admin": true, "config_file": "/root/.my.cnf", "connect_timeout": 30, "encrypted": false, "host": "rothko", "host_all": false, "login_host": "localhost", "login_password": "", "login_port": 3306, "login_unix_socket": null, "login_user": "root", "name": "root", "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "priv": "*.*:ALL,GRANT", "sql_log_bin": true, "ssl_ca": null, "ssl_cert": null, "ssl_key": null, "state": "present", "update_password": "always", "user": "root"}, "module_name": "mysql_user"},
- "item": "rothko",
- "msg": "unable to connect to database,
- check login_user and login_password are correct or /root/.my.cnf has the credentials.
- Exception message: (1045, "Access denied for user 'root'@'localhost' (using password: NO)")"}
- # - name: Create .my.cnf file with root password credentials
- # become: yes
- # template: src=".my.cnf.j2" dest="/root/.my.cnf" owner=root group=root mode=0600
- # - name: Restart mysql
- # service: name=mysqld state=restarted
- # - name: Change root user password on first run
- # mysql_user:
- # name=root
- # host=localhost
- # password={{ mysql_root_password }}
- # priv=*.*:ALL,GRANT
- - name: update mysql root password for all root accounts
- become: yes
- mysql_user:
- login_user=root
- login_password=''
- name=root
- host="{{ item }}"
- password="{{ mysql_root_password }}"
- check_implicit_admin=yes
- priv="*.*:ALL,GRANT"
- with_items:
- - "{{ ansible_hostname }}"
- - 127.0.0.1
- - ::1
- - localhost
- ignore_errors: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement