-
Notifications
You must be signed in to change notification settings - Fork 369
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
Setup from scratch needs two runs #157
Comments
@cboltz did you test the latest version of this formula? |
not if you define a salt_user ;-) - see my mail on the openSUSE heroes ML for details. |
@cboltz something like servers.sls
|
I'll take everything that works ;-) - and if it's better than my patch/pull request, I won't object. |
I haven't tested it I have tested the default mysql-formula on opensuse tumble and leap without your problems, that's why I was asking if you were running from the latest formula. |
@cboltz could you test it in your environment? |
Just to be sure - your proposal means to add (near the end of the section you quoted, around line 60 in server.sls)
Right? If I change this to |
Yes, that's the idea, except I'm not happy to hear that the mysql.salt-user state should be added by default to the init.sls maybe a similar wrap as the mysql.dev state could be achieved here.
|
This fixes #157 * Avoid failures on first run with a salt_user defined Add a dependency on sls: mysql.salt-user to ensure MySQL users (especially the salt_user) get created early enough - without that, parts of the first run will fail (but a second run works).
When setting up MySQL from scratch (without a pre-existing /var/lib/mysql/), I get errors like
This happens because mysql_delete_anonymous_user_* runs before the salt_user gets created.
Additionally, mysql.salt-user isn't included in init.sls, which means by default salt_user doesn't get created at all.
Proof of concept-patch:
Note that this patch is not perfect - requiring mysql_root_password delays mysql_delete_anonymous_user_* enough to get it working. However it uses the mysql_salt_user, not root - so the dependency on mysql_root_password is technically wrong ;-)
(CC @ccboltz)
The text was updated successfully, but these errors were encountered: