-
-
Notifications
You must be signed in to change notification settings - Fork 865
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
Initialize Custom Data Directory #518
Conversation
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. |
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
<#518 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALBHSD7LBYCKG3S3764WPLWZQSIRANCNFSM6AAAAAAVF4NAVI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
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. |
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? |
@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 |
@widhalmt let me take a look and try again. |
e25b692
to
6aeafa9
Compare
@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 |
@@ -80,6 +80,18 @@ | |||
- mysql_log_error | default(false) | |||
tags: ['skip_ansible_galaxy'] | |||
|
|||
- name: Initialize mysql when mysql_datadir is customized (MySQL) | |||
ansible.builtin.command: mysqld --initialize-insecure --user=mysql --datadir={{ mysql_datadir }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could interfere with later initialization, though, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which later initialization? I can't get molecule to run the rockylinux on my m1 mac, but the ubuntu2204 and 2004, both seem to pass the tests, when specifying an alternate data directory for both mysql and mariadb.
I am trying to modify the github actions to run the additional tests (I believe that is the way to do it?) I can't find a way to have different playbooks in molecule that tear down everything between playbooks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still depends. @geerlingguy do you want to have an extra molecule scenario for a moved directory or should it be part of default
? I made a PR to the PR of @misilot and I'm ready to change as you want it to have.
I can help you @misilot . But in short: If you want two different playbooks, you make two scenarios in Molecule. Copy the default
folder and change converge.yml
like you want the other playbook to be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I am working on the logic to check the version number instead of looking for package names, since debian uses mysql in the package name, but is really mariadb, the logic I have doesn't work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I fixed the logic, and they all seem to run locally with molecule. I also added in @widhalmt change to this PR.
6aeafa9
to
4c459f7
Compare
This is currently failing, but might just need a rebase? |
Partially Fixes geerlingguy#510 This will create the expected data directory. This most likely does not address protections in place because of AppArmor on Ubuntu Have to account for MariaDB and MySQL's differences in initalizing a new system
I just rebased, so we will see what it does. |
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. |
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. |
Partially Fixes #510
This will create the expected data directory. This most likely does not address protections in place because of AppArmor on Ubuntu