-
-
Notifications
You must be signed in to change notification settings - Fork 873
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
feat: use socket authentication as default for root #561
base: master
Are you sure you want to change the base?
feat: use socket authentication as default for root #561
Conversation
14a6db0
to
2dcfb73
Compare
e6c1a37
to
103019b
Compare
Hi @Al-thi , i've had this problem with my newest install as well, but i also got in some trouble trying you branch.
this does not apply to newest mariadb version, as those throw deprecation warning in their response of using mysql instead of mariadb:
could you update the script, to check for mysql vs mariadb and use mariadb if installed? |
@brunick Could you run the following command please: ls -l $(which mysql) I have seen many different configurations with some EDIT: could you please try the latest version ? It should run |
`mysql --version` returns a complete line that has to be parsed in order to extract the version value, e.g.: ``` mysql Ver 15.1 Distrib 10.11.6-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper ``` This commit makes the ansible variable `mysql_cli_version` to only store the interesting part of the returned line, e.g.: ``` 10.11.6-Mariadb ``` This will make version conditionals in tasks and templates easier everywhere else. Signed-off-by: Alexis Thietard <[email protected]>
Use ansible `version()` filter instead of substring detection. cf. the official documentation: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/version_test.html This will avoid potential versions detection false positives, with for example: ``` '8.0.' in mysql_cli_version ``` That could return `true` if the version was `11.8.0-MariaDB`. NB: This removes `query_cache_*` variables on MariaDB which do not work the same way as on MySQL, cf. https://mariadb.com/kb/en/server-system-variables/#query_cache_type ``` Warning: Starting from MariaDB 10.1.7, query_cache_type is automatically set to ON if the server is started with the query_cache_size set to a non-zero (and non-default) value. This will happen even if query_cache_type is explicitly set to OFF in the configuration. ``` It is misleading to have `query_cache_type: 0` by default and still enabling the `query_cache` feature, so this commit restricts `query_cache` explicit configuration to MySQL. This effectively resets the query cache to its default upstream value on MariaDB: * query cache enabled * query cache size: 1M * query cache limit: 1M Signed-off-by: Alexis Thietard <[email protected]>
…l versions Since MariaDB 10.4 / MySQL 8.4, the root mysql user is configured to use `unix_socket` instead of password authentication. No password is privisioned at MariaDB installation time for the root user. Using socket authentication is recommended and considered a good security practice. cf. https://mariadb.com/kb/en/authentication-from-mariadb-10-4/ cf. https://dev.mysql.com/doc/refman/8.4/en/native-pluggable-authentication.html Fix geerlingguy#550 Fix geerlingguy#522 Fix geerlingguy#431 Fix geerlingguy#421 Signed-off-by: Alexis Thietard <[email protected]>
cf. https://ansible.readthedocs.io/projects/lint/rules/yaml/#yaml Signed-off-by: Alexis Thietard <[email protected]>
Only use `true` / `false` for booleans. cf. https://ansible.readthedocs.io/projects/lint/rules/yaml/#yaml Signed-off-by: Alexis Thietard <[email protected]>
cf. https://ansible.readthedocs.io/projects/lint/rules/yaml/#yaml Signed-off-by: Alexis Thietard <[email protected]>
103019b
to
0b5b6c2
Compare
Hey @Al-thi,
|
@brunick did you try the latest version ? |
not yet, i had to create a workaround to get my server up'n'running i actually "only" had to add a root user with permissions to connect from 127.0.0.1 with a password. |
This is an attempt to allow the root account to use socket authentication instead of password authentication.
Socket authentication is the new default for both MariaDB and MySQL on modern versions.
The current role configuration causes authentication problems for the root account, cf. issues:
I've had authentication problems too, with the following message on every
mysq_db
andmysql_user
tasks:As this socket authentication is only effective on recent MySQL (≥ 8.4) / MariaDB (≥ 10.4) versions, this PR also refactors the version parsing by:
mysql --version
standard outputversion
filter instead of substring detection (with{{ 'something' in my_string }}
ansible variable)Finally, as there was some linting warnings, I also included syntax fixes in the 3 last commits.
Please tell me what you think of this :)
Thank you for your time and your amazing work.
Regards.