-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
Provisioning Remote Server w/ Remote SQL DB ‘true’ Issues #563
Comments
Previously you had to manually toggle the remote database option via `mysql_remote_database` (which also didn't fully work). Now Trellis automatically detects if the sites are using a remote `db_host` or not (aka not `localhost`) and handles things accordingly. This also installs the mysql-client now regardless.
Awesome addition right here. Got really busy but got a chance to test this branch out today in development and it worked out perfectly. Just may want to add in docs that you need to have the remote database already created in the proper format, example_com_development As long as you have the database available to connect to on the remote server it will install WP for you on that database. Thanks for the fix! |
Previously you had to manually toggle the remote database option via `mysql_remote_database` (which also didn't fully work). Now Trellis automatically detects if the sites are using a remote `db_host` or not (aka not `localhost`) and handles things accordingly. This also installs the mysql-client now regardless.
Fix #563 - Improve remote databases
* commit 'f1c4fb72009906244f512e82bb02c2f9435dbed0': (52 commits) Add Nginx variable to set fastcgi_buffer_size (roots#586) Require Ansible 2.0.2 and remove deploy_helper Pass cli options to user role's admin_user ping test Add connection-related cli options to ping command Wrap my.cnf password in quotes Update to WP-CLI v0.23.1 Fix roots#563 - Improve remote databases Update salts link to roots.io version Fix roots#569 Only skip subdomains for non-www domains Define development default for Let's Encrypt variable Enable Let's Encrypt to transition http sites to https Add 'reason' to attr extracted for pretty-print Adding dbus to essentials Pass vault cli args to remote-user ping task Tidy up sudoer password definitions and comments 👮 Fix ssmtp role tags 0.9.7 Fix ansible.cfg and Ansible plugins for moved Vagrantfile Enable color output for Vagrant shell provisioner windows.sh Tidy up output.py by moving some methods to utils ... # Conflicts: # roles/deploy/defaults/main.yml
* trellis-tmp: Require Ansible 2.0.2 Add Nginx variable to set fastcgi_buffer_size (roots#586) Require Ansible 2.0.2 and remove deploy_helper Pass cli options to user role's admin_user ping test Add connection-related cli options to ping command Wrap my.cnf password in quotes Update to WP-CLI v0.23.1 Fix roots#563 - Improve remote databases Enable color output for Vagrant shell provisioner windows.sh # Conflicts: # Vagrantfile # group_vars/all/database.yml # roles/mariadb/defaults/main.yml
* merge-0.9.7: Newline fix. Require Ansible 2.0.2 Add Nginx variable to set fastcgi_buffer_size (roots#586) Require Ansible 2.0.2 and remove deploy_helper Pass cli options to user role's admin_user ping test Add connection-related cli options to ping command Wrap my.cnf password in quotes Update to WP-CLI v0.23.1 Fix roots#563 - Improve remote databases Enable color output for Vagrant shell provisioner windows.sh
Bug report
Please provide steps to reproduce, including full log output:
Provisioning a remote server with newest master branch of Trellis with the variable for remote sql set to true.
mysql_remote_database: true
I have tried it with it set to true from first provision (so no mariadb ever installed) and also provisioning first so mariadb gets installed then switching afterwards.
Either way Trellis will always fail when trying to connect to the remote db and will act like it can't find a local database even though db_host is set to an IP address.
Fails with the error "Access denied for root@localhost(using password YES)"
I also tried SSHing into the server and running 'wp db' commands after verifying that the .env file 100% had the REMOTE DB settings loaded in it. Every time it still wants to connect root@localhost
After trying a few things I decided to ssh into the server and install the package
mysql-client, which I don't think ended up helping.
(This is with no mariadb role run ever)
Then I edited /etc/mysql/my.cnf file and changed the variable 'bind-address' from the local ip 127.0.0.1 to my remote IP, then everything worked as expected.
So it seems the Ansible roles are running through the mysql socket which is set to localhost exclusively. Once I changed the bind address like I said I am able to run commands on the remote DB all day.
Please describe your local environment:
Ansible version: 2.0.0.2 and also tried 2.0.1.0
OS: Running the Trellis playbook from an Ubuntu 14.04 instance provisioned on Google Cloud Platform
DB Server: Google Cloud SQL
Note: I have successfully completed this exact provisioning numerous times using the same env variables.
Where did the bug happen? Development or remote servers?
Remote server, Ubuntu 14.04 Google Cloud Compute Instance
Please provide a repository or your
wordpress_sites
config (if possible):Is there a related Discourse thread or were any utilized (please link them)?
https://discourse.roots.io/t/provisioning-remote-server-w-remote-sql-db-true-issues/
Other relevant information:
Like I said as soon as I changed the socket IP it started working perfectly
The text was updated successfully, but these errors were encountered: