mam problem z instalacją MySQL z ansibla na Vagrant ubuntu,zainstalować MySQL z ansibla na ubuntu
To moja część MySQL
---
- name: Install MySQL
apt:
name: "{{ item }}"
with_items:
- python-mysqldb
- mysql-server
- name: copy .my.cnf file with root password credentials
template:
src: templates/root/.my.cnf
dest: ~/.my.cnf
owner: root
mode: 0600
- name: Start the MySQL service
service:
name: mysql
state: started
enabled: true
# 'localhost' needs to be the last item for idempotency, see
# http://ansible.cc/docs/modules.html#mysql-user
- name: update mysql root password for all root accounts
mysql_user:
name: root
host: "{{ item }}"
password: "{{ mysql_root_password }}"
priv: "*.*:ALL,GRANT"
with_items:
- "{{ ansible_hostname }}"
- 127.0.0.1
- ::1
- localhost
I mam ten błąd
failed: [default] => (item=vagrant-ubuntu-trusty-64) => {"failed": true, "item": "vagrant-ubuntu-trusty-64"}
msg: unable to connect to database, check login_user and login_password are correct or ~/.my.cnf has the credentials
failed: [default] => (item=127.0.0.1) => {"failed": true, "item": "127.0.0.1"}
msg: unable to connect to database, check login_user and login_password are correct or ~/.my.cnf has the credentials
failed: [default] => (item=::1) => {"failed": true, "item": "::1"}
msg: unable to connect to database, check login_user and login_password are correct or ~/.my.cnf has the credentials
failed: [default] => (item=localhost) => {"failed": true, "item": "localhost"}
msg: unable to connect to database, check login_user and login_password are correct or ~/.my.cnf has the credentials
mój .my.cnf jest
[client]
user=root
password={{ mysql_root_password }}
a gdy skopiowane na serwer
[client]
user=root
password=root
nie rozumiem dlaczego, ~/.my.cnf jest tworzony
projektu Github
Dzięki
proszę udostępnić szablon '.my.cnf'. – tedder42
@ tedder42 done;) – Ajouve
Świetnie, mam złożoną odpowiedź, po prostu podwójnie sprawdzam ją w stosunku do świeżego instancji testowej. – tedder42