Skip to content
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

fixes #214 #220 #233

Closed
wants to merge 22 commits into from
Closed

fixes #214 #220 #233

wants to merge 22 commits into from

Conversation

t0rrant
Copy link
Contributor

@t0rrant t0rrant commented Jan 25, 2019

Description

Mainly fixes setting the root password in the server_install recipe. The way this is achieved is by first killing off any mysql service that may be running (and which are properly registered in /var/run/mysql/mysqld.pid), launching up a mysqld service manually, with an initial script which sets the root password. Then it tries to authenticate with that password, and if it is okay, it kills that process in order to allow the proper mariadb service to start.

Properly checks for the node['mariadb']['server_root_password'] attribute being set, as well as the password property being passed.

Fixes errors about the way the only_if guard is evaluated, it is now evaluated as a code block.

Also removed a reference in the integration tests about the reload function for mariadb service, which does not support this function.

Issues Resolved

#214 #220

Check List

fixes `only_if` and mysql query issues with setting password
before starting the service, checks for an initial config file, creates it if it doesn't exist and runs mysqld with init-file argument
minor fix, file has :create, not :run...
path got lost somewhere in time
Updated mysqld command to run as root for setting the initial password as per https://dev.mysql.com/doc/refman/5.7/en/changing-mysql-user.html
updates root password, and verifies it was updated
added failsafe to make sure the mysql service is not running
added failsafe to make sure the mysql service is not running
added failsafe to make sure the mysql service is not running
removed reload support as mariadb service does not support it and can be misleading
added presence test for pid_file
fixing issues with kill
fixing issues using kill
apparently the mysqld service is stopped afterwards
improved resource notifications
improved resource notifications
removed `only_if` clause, as `generate-mariadb-root-password` resource already creates the file for us and is required by this resource
removed `only_if` clause, as `generate-mariadb-root-password` resource already creates the file for us and is required by this resource
working out chef resource behaviour...
fixes linting
@kitchen-porter
Copy link
Contributor

1 Error
🚫 Please include a CHANGELOG entry.

Generated by 🚫 Danger

bad boolean algebra... it would not apply password if there was any mysqld process to kill
@t0rrant
Copy link
Contributor Author

t0rrant commented Jan 28, 2019

I just realized a big mistake on the boolean algebra, closing another one...
Is it possible to update a PR instead of submitting another one?

@t0rrant t0rrant closed this Jan 28, 2019
@lock
Copy link

lock bot commented Jan 28, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants