-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
mysql_db: add use_shell parameter to prevent Broken pipe errors #151
mysql_db: add use_shell parameter to prevent Broken pipe errors #151
Conversation
You definitely need a changelog fragment :) |
@felixfontein , yep, thanks! but i'm not sure it'll help because i can't reproduce the situation to check the result. |
@Andersson007 maybe mark the PR as |
@felixfontein yep, worth doing it not to confuse contributors:) |
Hi @Andersson007, Until now I've only used Ansible installed from Repos. How could I test your PR? Could I just check it out via git and run it from git directory on my local machine? |
@Tronde I've started writing some docs on how to use collections from Git repositories locally: https://github.com/ansible/ansible/pull/68899/files#diff-69c6b826eb7e42d76e3c24504fe1292bR578-R600 If you do this (with @Andersson007's fork of community.general and the right branch) and use the FQCN |
@felixfontein thanks!
Myabe it's not the best practice but it should work:) |
The fix is pretty simple |
Well, I found the mysql_db.py on my system, but it seems to be quite different from the on above. I'm using ansible 2.9.6 from epel7. I've inserted the
But that did not fix the issue. |
@Tronde thank you for testing! i came up with a new possible solution:) coming soon |
@Tronde , did you convert |
anyway, could you try the last changes please. I hope we'll solve the problem together.
If it solves the problem, i'll do it configurable via a new parameter. |
Thanks for your patience with me. So my code looks like the following, now:
Now, my playbook fails with: I'm not sure if that's related to the change in the code or the sql file. But I could import the file locally. |
please remove these lines and run again |
I did and got a module error:
|
Oh, sorry
it doesn't exist in 2.9, so we need to remove this too. |
Hi @Andersson007, That was fun. Thank you for guiding me. |
@Tronde |
ready_for_review |
@bmalynovytch , needs your opinion |
@Tronde done, if this solution is ok for you, please put |
shipit |
has CI + tested manually, so, merged into master |
@Tronde thanks much for reporting and helping! |
@Andersson007 it has been a pleasure to help! |
SUMMARY
Fixes ansible/ansible#20196
mysql_db
: prevent broken pipe errors whenstate=import
by using an intermediate shell processAdded the
use_shell
parameter.ISSUE TYPE
COMPONENT NAME
plugins/modules/database/mysql/mysql_db.py