ansible/library
Stijn Tintel 9d0fc0fd67 Only revoke GRANT OPTION when user actually has it
When revoking privileges from a user, the GRANT OPTION is always
revoked, even if the user doesn't have it. If the user exists, this
doesn't give an error, but if the user doesn't exist, it does:

mysql> GRANT ALL ON test.* TO 'test'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> REVOKE GRANT OPTION ON test.* FROM 'test'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> REVOKE GRANT OPTION ON test.* FROM 'test'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> REVOKE ALL ON test.* FROM 'test'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> REVOKE GRANT OPTION ON test.* FROM 'test'@'localhost';
ERROR 1141 (42000): There is no such grant defined for user 'test' on
host 'localhost'

Additionally, in MySQL 5.6 this breaks replication because of
http://bugs.mysql.com/bug.php?id=68892.

Rather than revoking the GRANT OPTION and catching the error, check if
the user actually has it and only revoke it when he does.
2013-07-23 13:00:29 +02:00
..
cloud Remove end of line semicolons. 2013-07-21 11:55:38 -04:00
commands Docs: consistently format playbook EXAMPLES 2013-06-17 08:53:46 +02:00
database Only revoke GRANT OPTION when user actually has it 2013-07-23 13:00:29 +02:00
files Remove reference to 'context' since it's not implemented. 2013-07-21 11:52:22 -04:00
internal * Updated all ansible.cc references in the documentation to point 2013-06-19 19:34:02 -06:00
inventory Trim legacy variable usage. 2013-07-19 09:44:25 -04:00
messaging Add missing version_added description in docs. 2013-07-20 12:08:47 -04:00
monitoring Trim old style var references. 2013-07-19 09:38:31 -04:00
net_infrastructure Changed shebangs that use /usr/bin/env to use /usr/bin/python and therefore be compatible with the ansible_python_interpreter variable. 2013-07-17 16:37:04 -04:00
network Trim old style var references 2013-07-19 09:37:19 -04:00
notification Legacy variable usage. 2013-07-19 09:45:08 -04:00
packaging Fix prev feature commit, Do not require aptitude to use apt commands in the apt module, only needed when upgrading. 2013-07-22 15:15:55 -04:00
source_control Don't add --version HEAD parameter is already HEAD, some versions of git don't like this. 2013-07-20 11:24:16 -04:00
system Continue on mount errors, don't fail the setup module. 2013-07-22 13:57:35 -04:00
utilities Legacy variable usage removed 2013-07-19 09:40:00 -04:00
web_infrastructure Update htpasswd module for various API incompatibilities 2013-07-20 18:22:58 -04:00