geerlingguy / ansible-role-phpmyadmin

DEPRECATED Ansible Role - phpMyAdmin
https://galaxy.ansible.com/geerlingguy/phpmyadmin/
MIT License
42 stars 41 forks source link

Customized config #15

Closed benroose closed 4 years ago

benroose commented 5 years ago

Dear Jeff Geerling, (I had some errors when attempting to rebase in last pull request. Wanted to start fresh without merge conflicts occurring. So here is a second attempt. Sorry for the issue.)

Recently read your great textbook, Ansible for DevOps. I'm currently guiding one of my college students through your textbook too, so she can also get into Ansible automation. Thank you for writing such a great, hands-on book on the subject!

I'm starting to migrate our system automation code over to Ansible in the Computer Science dept. at Wichita State University. I'm currently building a MariaDB/mySQL service on our OpenStack cloud for CS students to have easy access to a live SQL environment in their "Intro to Databases" class. Basing this new SQL service on your multi-server LAMP Infrastructure textbook example, but adding your phpMyAdmin role onto the www servers to ultimately give students a simple SQL web interface into the MariaDB server.

I found your phpMyAdmin role did not touch the default Apache config file phmyadmin.conf. So it seemed to only allow for localhost access into phpMyAdmin. To integrate it into your LAMP infrastructure, the phpMyAdmin directories needed to be accessible from the Varnish server.

I hope it is okay, but I have added to this role:

automated configuration of the Apache phpmyadmin.conf with user definable 'require ip' and 'allow from' values using a template,
new webserver restart handler (similar to the handler in your php role),
new phpmyadmin_use_default_config variable check, in case user wishes to copy a more complex custom config.inc.php (this idea was borrowed from your varnish role and seemed like a good extra option), and
additional documentation in the README.md file with details of the new variables.

This is my first pull request for an Ansible role. Please feel free to change or delete my code as you see fit. Also, I was able to test the role changes on the CentOS 7 LAMP infrastructure and everything seemed to work great. However, I do not have travis/molecule running here, so was not able to run complete tests on the code changes with different distributions.

Thank you for taking the time to review (and hopefully merge) this pull request.

Best regards, Ben

P.S. On a separate question: within your textbook LAMP infrastructure example itself, I seem to be hitting an error with the mySQL master/slave servers not replicating correctly. I'm seeing the error: TASK [geerlingguy.mysql : Check slave replication status.] ***** fatal: [a4d-lamp-db-1]: FAILED! => {"changed": false, "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 'replication'@'localhost' (using password: YES)")"}

My next task is to deep dive into your mysql role and further troubleshoot this error. However, any help from someone who is much better versed than I with this code would be much appreciated. Could you please let me know if you have seen similar replication access denied errors in the past and if there are any specific fixes or places I should check in your LAMP example to resolve this master/slave replication problem?

stale[bot] commented 4 years ago

This pull request has been marked 'stale' due to lack of recent activity. If there is no further activity, the PR will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark pull requests as stale.

stale[bot] commented 4 years ago

This pull request has been closed due to inactivity. If you feel this is in error, please reopen the pull request or file a new PR with the relevant details.