-
Notifications
You must be signed in to change notification settings - Fork 794
Fix puppet error when setting etc_root_password in mysql. #193
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
Conversation
As this PR stands I think this is a bad idea. Mostly because I don't want to see any more defined() use as it causes parsing problems. I have a better suggestion for this if you feel like tackling it - we introduce concat into the module and convert the two file{} resources:
Into concat::fragments. That way it can happily drop in the additional [client] section fragment to /etc/my.cnf in the case of etc_root_password. This will need a bunch of changes:
If you're willing to make a stab at this, awesome! If not come back to me in the comments and we'll work on it together. |
I'm trying to figure out what It looks like It appears that
The short-term fix would probably be to add the password fragment from Long term would be to audit and potentially redraft the authentication workflow of the module. This looks like organically-grown madness and should be fixed by removing code rather than adding patches. |
My gut feeling is the same as hunner's. I'm not sure what |
I like this idea, I was having a lot of trouble understanding etc_root_password and the use case for it. I just assumed there was some cases I didn't understand where this made sense. |
Looks like |
I think the quickest way forward would be to cause |
Actually probably more like: <% if @etc_root_password -%>
password='<% @root_password %>'
<% end -%> and use |
14:48:13 <+bodepd> ashp: I though it existed to allow to set the password in /etc/my.cnf instead of /root/my.cnf So basically bodepd doesn't really remember either, I don't think we need to put any more thought into this one. :) |
The old way would break lots of things because the two templates collided. This new way should let all configs coexist. The "before => File[$config_file]" line on setting the root password is necessary so that the mysqladmin command uses the old configuration before changing the password; without this, changes to the root password fail on the first provisioning.
Added a commit that does as hunner prescribes. Tested locally, but let's see if Travis likes it. I'm also happy to change the PR to delete the feature entirely. |
Hmm. This appears to be on purpose on RedHat (https://github.com/puppetlabs/puppetlabs-mysql/blob/master/spec/classes/mysql_config_spec.rb#L212) as I'm working on getting some rspec-system tests added which would probably make it easier to answer this question if I knew why the password was being added to the etc-config's client section in the first place. |
That's quite strange. I set the I'm equally clueless about what |
Hi, I've recently merged in a very large changeset that completely redesigns this module. As a result I'm afraid this PR is no longer mergeable and possibly no longer valid (sorry, mass message for all PRs) due to the changes to binding and the removal of most of the parameters for my.cnf (as it's handed by an override hash currently). I'm going to close all existing PRs that can't be merged and ask you to take a look at rebasing them against master or redeveloping them against master if the feature is still important to you. I hope that many of the existing PRs won't be needed in the refactoring! Thanks for your patience everyone, I know this is pain. |
Puppet agent fails with duplicate definition errors if I enable
etc_root_password
.This patch avoids the error by omitting the standard definition.