Comments (13)
I have the exact same issue.
Were you able to solve it?
Thanks
from ansible-role-mysql.
@nestormata as I said I've changed remote_user to root and that task had completed.
from ansible-role-mysql.
This would also be fixed by the changes listed in #36, but since that issue won't be able to be fixed for at least a few weeks, I would like to update the documentation to make this requirement a more explicit.
Another option, btw, would be to set mysql_user_home
to /home/vagrant
. That may work.
from ansible-role-mysql.
Adding postponed label; will wait until a little time after Ansible 2.0.0 is released.
from ansible-role-mysql.
@geerlingguy no, it does not work, I've just tried. The problem is the .my.cnf
file is owned by root with 600 permissions. I wonder why that file can't be read though, hence sudo: yes
is used.
from ansible-role-mysql.
@chuwy that's not an option either, you cannot connect to a vagrant box with root user.
from ansible-role-mysql.
I found a temporary workaround. Add this to your playbook (and leave mysql_user_home
default value (root)):
become_method: su
You can also add this post_task to copy the .my.cnf to the vagrant home directory for future usage:
post_tasks:
- stat: path=/root/.my.cnf
register: mysql_config_exists
- shell: cp /root/.my.cnf /home/vagrant/.my.cnf && chown vagrant. /home/vagrant/.my.cnf
when: mysql_config_exists.stat.exists
from ansible-role-mysql.
@sagikazarmark - Interestingly, the role works fine with Drupal VM and is able to mange the file without any issues. I wonder if there's something else about the configuration/setup of the Vagrant box(es) being used that's causing a problem.
from ansible-role-mysql.
I doubt it, it's a plain ubuntu box:
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.synced_folder ".", "/vagrant", id: "application"
config.vm.provision "ansible" do |ansible|
ansible.playbook = ".ansible/playbook.yml"
end
end
Even if it is platform specific thing, user should be able to install the file in whatever user, not just with root as owner.
from ansible-role-mysql.
The file is placed at the given user home (/home/vagrant), but the user cannot read it (hence the root privileges). Even if it works in some environments, I still think the file should be placed with a proper owner. (Into ssh user's home, and ssh user as owner by default)
from ansible-role-mysql.
Setting remote_user = root
in ansible.cfg makes no difference for me when provisioning Ubuntu 14.04.4 x64 on DigitalOcean.
from ansible-role-mysql.
I am getting this error in Travis and NOT in Vagrant
lots of attempts at fixes also
TASK [geerlingguy.mysql : Get list of hosts for the anonymous user.] ***********
fatal: [localhost]: FAILED! => {"changed": false, "cmd": ["mysql", "-NBe", "SELECT Host FROM mysql.user WHERE User = """], "delta": "0:00:00.007884", "end": "2016-05-03 06:55:22.457248", "failed": true, "rc": 1, "start": "2016-05-03 06:55:22.449364", "stderr": "ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)", "stdout": "", "stdout_lines": [], "warnings": []}
from ansible-role-mysql.
I'm actually still having issues with this on my Ubuntu 14.04 hosts at the same spot as @niccolox. Looks like the mysql-client is just ignoring the /root/.my.cnf
file even if I ssh into the server itself as root.
Update:
Must not have installed the latest master (6 days ago) though as I noticed password wasn't in quotes in .my.cnf
. Solves the issue for us.
from ansible-role-mysql.
Related Issues (20)
- Change mysql_bind_address: '0.0.0.0' to mysql_bind_address: '127.0.0.1' in defaults HOT 2
- Add additional innodb tunables to configuration HOT 4
- Missing community.mysql HOT 2
- ERROR! 'include_tasks' is not a valid attribute for a Play HOT 4
- MySQL fails to start when `mysql_datadir` is set to anything other than MySQL's default HOT 13
- 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 5
- 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 2
- 'sudo mysql' allows access w/o password authentication after fresh install HOT 1
- root password with $ or %
- 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
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.