-
Notifications
You must be signed in to change notification settings - Fork 88
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_query check mode using transaction #613
Comments
@drzraf hello, thanks for opening the issue, and at the first glance it sounds reasonable.
I see @markuman seems to like the idea, thanks |
I'm not totally comfortable with the idea. I see ansible check_mode as something really safe. But here, it would create a real transaction on a live server! If we are 99% sure it won't create any deadlock or other nasty things in the database server, then yeah, this feature seems cool! But I'm failing to imagine a use case. @drzraf can you tell us more please? What do you want to test with the check_mode? That you have the necessary privileges? That the table exists? In what situation? What kind of tables do you edit from Ansible? |
I've several mysqld running with similar DB structures and use ansible not only for provisioning but as my go-to command multiplexer. (Using playbooks or I encountered situation where an It's not bullet-proof in the sense that it won't avoid all possible mistakes. ... but supporting check-mode will always be an improvement over the current situation where the admin has no clue about the result of the request in -prod before it's run and he's gonna run it anyway... "blindly". 99% read-only certainty ?, likely.
Disable auto-reconnect may be desirable:
We wouldn't want a statement to be run outside a transaction just because a disconnection happened right after "START TRANSACTION" but before the r/w statement. |
SUMMARY
mysql_query should support check mode using
start transaction
ISSUE TYPE
COMPONENT NAME
mysql_query
ADDITIONAL INFORMATION
Quick and dirty proposal:
community.mysql/plugins/modules/mysql_query.py
Lines 171 to 173 in 32718ca
Current workaround
The text was updated successfully, but these errors were encountered: