geerlingguy / ansible-role-mysql

Ansible Role - MySQL
https://galaxy.ansible.com/geerlingguy/mysql/
MIT License
1.05k stars 861 forks source link

Initialize Custom Data Directory #518

Closed misilot closed 7 months ago

misilot commented 1 year ago

Partially Fixes #510

This will create the expected data directory. This most likely does not address protections in place because of AppArmor on Ubuntu

geerlingguy commented 1 year ago

Since I don't customize the dir, I'd like someone else to confirm this works / test it out (preferably across a couple platforms) before merging. Also, it might be nice to test it in CI.

misilot commented 1 year ago

Any tips or examples of how we might add a test to CI?

Thanks!

On Sun, Feb 26, 2023 at 10:09 PM Jeff Geerling @.***> wrote:

Since I don't customize the dir, I'd like someone else to confirm this works / test it out (preferably across a couple platforms) before merging. Also, it might be nice to test it in CI.

— Reply to this email directly, view it on GitHub https://github.com/geerlingguy/ansible-role-mysql/pull/518#issuecomment-1445673259, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALBHSD7LBYCKG3S3764WPLWZQSIRANCNFSM6AAAAAAVF4NAVI . You are receiving this because you authored the thread.Message ID: @.***>

widhalmt commented 1 year ago

Hi. I just ran into the same issue. I do have to change the data dir. So I'll check the change. And I can help with the CI part, too.

widhalmt commented 1 year ago

Was easier than expected since there's only one molecule scenario. @geerlingguy I'll post a PR shortly with setting the variable in this one scenario. Is that what you thought of? Or would you like to have an extra scenario to test changed variables? I saw your default scenario is quite straight forward so maybe you want to keep it that way and have another one for more peculiar setups?

widhalmt commented 1 year ago

@misilot I tried your solution on Ubuntu 20.04 with MariaDB 10.3.38. It created the usual InnodDB file but not the default database like the mysql one. It only worked when I ran mysqld_install_db. Maybe you need to change your Merge Request. If it worked for you, I need to dig deeper.

misilot commented 1 year ago

@widhalmt let me take a look and try again.

misilot commented 1 year ago

@widhalmt so MariaDB and MySQL have different ways to initialize the data directory. I added a conditional to check if mariadb-server exists in the mysql_packages variable.

geerlingguy commented 1 year ago

This is currently failing, but might just need a rebase?

misilot commented 1 year ago

I just rebased, so we will see what it does.

github-actions[bot] commented 9 months ago

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

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

github-actions[bot] commented 7 months ago

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