Matt Martz
aaf762573e
Various simple linting type cleanups on modules
2016-12-08 11:24:06 -05:00
Toshio Kuratomi
50eda6c62e
password needs to be type str.
...
In 1.9 this was the default. In 2.0.0 and 2.0.1 this doesn't get set.
2.1.0 will fix the default but we should fix this now.
2016-12-08 11:24:05 -05:00
Lee H
8e84ba71ae
- fix check_mode test to avoid errors
...
- correct test mode check to ensure it returns and doesnt apply changes
(via jmainguy)
2016-12-08 11:24:00 -05:00
Mark van Driel
a24cdbe15e
Fixed "invalid privileges string: set expected at most 1 arguments, got 2"
2016-12-08 11:23:58 -05:00
Jonathan Mainguy
e9a752f769
add ansi support
2016-12-08 11:23:58 -05:00
Mark van Driel
d67f2eb104
Fixes require ssl in combination with other privileges
...
Fixes require ssl in combination with grant option
Refactoring: code cleanup to make it easier to understand
Code rewritten inspired by @willthames
Added WITH GRANT OPTION as exception; when only REQUIRESSL and/or GRANT are specified we have to add USAGE
2016-12-08 11:23:57 -05:00
KIKUCHI Koichiro
2974358b2b
Add check_mode support to mysql_user.
2016-12-08 11:23:56 -05:00
Jonathan Mainguy
47d0719cfe
Fix bad merge
2016-12-08 11:23:56 -05:00
Josh Rendek
bddcf737c9
Fix quote on grants of more than one word
...
Fixed a quote location on the grants composed of more than one word. Current docs will raise an error with a invalid privilege command.
2016-12-08 11:23:55 -05:00
Toshio Kuratomi
65b9243056
mariadb isn't always the last elemen of the version string
2016-12-08 11:23:53 -05:00
Toshio Kuratomi
0a64899eba
Fix mysqldump usage of config_file
2016-12-08 11:23:53 -05:00
Toshio Kuratomi
dafb39da2e
Account for mariadb versioning
2016-12-08 11:23:53 -05:00
Jonathan Mainguy
0cdb2719e5
Unify all 3 mysql modules.
...
Use same connection method, use config_file, and add ssl support
2016-12-08 11:23:53 -05:00
Lee H
7feb64d31c
- add version_added as requested to host_all
2016-12-08 11:23:53 -05:00
Lee H
5606197c28
- remove user_anonymous as the same thing can be accomplished by user='', but leave in the examples for removing anonymous users
2016-12-08 11:23:53 -05:00
Lee H
95895177d0
- add example showing removal of anonymous user accounts
2016-12-08 11:23:52 -05:00
Jonathan Mainguy
b86224a7ec
Add Jmainguy as author, fix hash check
2016-12-08 11:23:52 -05:00
Lee Hardy
f2f0f83ee6
- fix user_exists statement with host_all to use only username parameter
2016-12-08 11:23:52 -05:00
Lee Hardy
1113975741
- mysql: add user_anonymous parameter, which interacts with anonymous users - mysql; add host_all parameter, which forces iteration over all 'user'@... matches
2016-12-08 11:23:51 -05:00
Derek Smith
b9baed507b
updated examples
...
added mysql 5.7 user password modification support with backwards compatibility
resolved mysql server version check and differences in user authentication management
explicitly state support for mysql_native_password type and no others. fixed some failing logic and updated samples
updated comment to actually match logic.
simplified conditionals and a little refactor
2016-12-08 11:23:51 -05:00
trevoro
b5a3dd4818
adding password_hash support to mysql_user module
...
fixing user_add arguments error
fixing user_mod arguments error
2016-12-08 11:23:51 -05:00
Mark Theunissen
c3450d542f
Remove Mark Theunissen as maintainer
2016-12-08 11:23:50 -05:00
Jonathan Mainguy
caf6115f43
Update documentation to reflect need for mysql client
2016-12-08 11:23:46 -05:00
wtanaka.com
c31a6fd23f
Update target parameter documentation
...
xz support was only added recently (2015-05-15), so referring to it
unqualified in the online documentation is confusing.
2016-12-08 11:23:46 -05:00
Brian Coca
3906fd426b
document mysql collation can only be set during creation
2016-12-08 11:23:44 -05:00
Jonathan Mainguy
833676960d
Update doc to reflect password is required if adding a new user
2016-12-08 11:23:44 -05:00
Jonathan Mainguy
346c9ab80e
Update error message to be more explicit
2016-12-08 11:23:44 -05:00
Sam Yaple
f2c1eeb54c
Actually remove the section we are replacing
2016-12-08 11:23:32 -05:00
Sam Yaple
52d364b74c
Refix bug 1226 after revert
...
This patch properly fixes bug 1226 without introducing a breaking
change to idempotency which was introduced in PR #1358
We can properly assign permissions to databases with a '.' in the name
of the database as well as assign priviliges to all databases as
specified with '*'
2016-12-08 11:23:32 -05:00
Sam Yaple
f8bcdffa36
Revert "escapeds changes"
...
While this change doesn't break the creation, it does break
idempotency. This change will convert '*.*' to '`*`.*' which is
functionally the same, however when the user_mod() function looks up
the current privileges with privileges_get() it will read '*.*'
Since '*.*' != '`*`.*' it will go through the process of updating the
privleges always resulting in a 'changed' result.
This reverts commit db9ab9b2629f00350a743a4eca72fb5ee8dc8c77.
2016-12-08 11:23:31 -05:00
Guilherme Carlos
aaac05c96c
Fix login_user on mysql_user
...
`login_username` was provided but `login_user` is the correct option
2016-12-08 11:23:24 -05:00
Jesse Sandberg
807feb3ac4
Validate variable, return only the found variable value instead of tuple
...
Docs imply the mysql_variables is used to operate a single variable therefore
- fail before making any db connections if variable is not set
- validate chars for mysql variable name with re.match(^[a-z0-9_]+)
- use "SHOW VARIABLE WHERE Variable_name" instead of LIKE search
- getvariable() returns only the value or None if variable is not found
- the module returns only the found variable value instead of tuple for easier operation eg. as registere variable in tasks
2016-12-08 11:23:24 -05:00
sysadmin75
9bd58bd224
Fix to revoke privileges for mysql user = '' Issue #9848
2016-12-08 11:23:24 -05:00
acaveroc
dda41fd95a
Add version_added and type of parameter
2016-12-08 11:23:19 -05:00
acaveroc
2c6f69c95e
Assorted minor bug fixes
...
- Modified data type for port definition from string to integer
- Modified login_host default value for compatibilize with port definition according with MySQL Documentation (https://dev.mysql.com/doc/refman/5.0/en/connecting.html )
2016-12-08 11:23:19 -05:00
acaveroc
1283fdd118
Add port definition support for mysql_vars module
2016-12-08 11:23:19 -05:00
Matt Martz
3d28efaf7e
Replace tabbed indentation with spaces for mysql_db module
2016-12-08 11:23:16 -05:00
Bryan Fleming
6f8d60a5ed
fixes #1120 - privileges using columns
2016-12-08 11:23:13 -05:00
Sergei Antipov
e62f870859
mysql_user | Hide password
2016-12-08 11:23:08 -05:00
Greg DeKoenigsberg
eb881d7d5d
Proper author info for all remaining modules
2016-12-08 11:23:07 -05:00
Louis-Michel Couture
03240cfcb6
Update example to remove outdated information
2016-12-08 11:23:05 -05:00
Toshio Kuratomi
5027fc0642
Expand tildes and vars in the config file path
2016-12-08 11:23:03 -05:00
Toshio Kuratomi
4f42e752e6
Allow playbook specified login_user and login_password to override config file settings
2016-12-08 11:23:03 -05:00
Toshio Kuratomi
0af631499a
Use a list comprehension instead of map and lambda
2016-12-08 11:23:02 -05:00
Toshio Kuratomi
c291c2dfea
Fix for the new import code when password is empty
2016-12-08 11:23:02 -05:00
Dennis Rowe
5109628693
Strip spaces around perms
2016-12-08 11:23:02 -05:00
Johann Schmitz
8f8109f1e0
Improved output of mysql_db plugin
...
Show error number and error description on connect error to ease debugging.
2016-12-08 11:23:02 -05:00
Jonathan Mainguy
7ab2ddbe2a
escapeds changes
...
fixed merge conflict
remove uneeded regexs
arrays
2016-12-08 11:23:02 -05:00
Robin Miller
a2f685a134
Replaced lambda functions with list comprehensions.
2016-12-08 11:23:02 -05:00
Robin Miller
8859a7cf8e
Only revoke actually granted permissions, not 'ALL'.
...
This prevents errors when the login_user does not have 'ALL'
permissions, and the 'priv' value contains fewer permissions than are
held by an existing user. This is particularly an issue when using an
Amazon Web Services RDS instance, as there is no (accessible) user with
'ALL' permissions on *.*.
2016-12-08 11:23:01 -05:00
fdupoux
e34c7f31dc
Refactoring to avoid duplication of code which manages the decompression of database dumps in various formats
2016-12-08 11:23:01 -05:00
fdupoux
9b83311471
Simplify code which prepares the decompression command
2016-12-08 11:23:01 -05:00
Toshio Kuratomi
dd4838e4aa
Refactor dump compression and use get_bin_path for finding the compressors
2016-12-08 11:23:01 -05:00
fdupoux
aa79810cc8
Decompress mysql dumps on the fly using python subprocess during an import to simplify operation
2016-12-08 11:23:01 -05:00
Jonathan Mainguy
b25bc20d3d
changes hostname to lowercase
2016-12-08 11:23:00 -05:00
Brian Coca
831af880f0
minor doc fix and made sure check_implicit_admin is true boolean
2016-12-08 11:23:00 -05:00
fdupoux
6f2f07ef51
Add support for xz compression (for dump and import) in mysql_db module
2016-12-08 11:22:59 -05:00
Jonathan Mainguy
1ba2e34ae1
Adds all_databases option which allows a user to dump or import all databases at once, identical to mysqldump --all-databases
...
fix line 132
Update to name=all
cleaned up all_database per abadger's suggestions
2016-12-08 11:22:57 -05:00
Julia Kreger
6f7cd5c307
Set default for mysql_user config_file
...
The default value set by the module was a value of None for the
config_file parameter, which propogates into the connect method
call overriding the stated default in the method.
Instead, the default should be set with-in the parameter
specification so the file check is not requested to check None.
2016-12-08 11:22:56 -05:00
Sven Schliesing
90d434d66d
use default value for parameter config_file in connect()
2016-12-08 11:22:55 -05:00
muffl0n
62bc6f2ba6
Use MySQLdbs read_default_file
2016-12-08 11:22:55 -05:00
Solomon Gifford
d14bbf514e
mysql_user #829 : add update_password to mysql_user
2016-12-08 11:22:52 -05:00
Toshio Kuratomi
e5ba4e87d8
Fix for int port assignment in a playbook failing
...
Ports are integer values but the old code was assuming they were
strings. When login_port is put into playbook complex_args as an
integer the code would fail. This update should make the argument
validating make sure we have an integer and then we can send that value
directly to the relevant APIs.
Fixes #818
2016-12-08 11:22:46 -05:00
Jonathan Mainguy
1608163b26
Now correctly gzip/bzips file back up in case of import failure
...
Removed gunzip and bunzip2 dependency
2016-12-08 11:22:46 -05:00
Toshio Kuratomi
b9984b1dfe
Fix documentation to have correct param name
2016-12-08 11:22:45 -05:00
David Hummel
63e9de3170
Fix issue #793 : mysql_db: for state={absent,present} connections to database mysql fail for users other than root
2016-12-08 11:22:42 -05:00
Toshio Kuratomi
e11ea4b402
Also catch mysql errors so we can give the error message back through json rather than tracebacking
2016-12-08 11:22:37 -05:00
Bruce Pennypacker
605a5a5b53
requested changes
2016-12-08 11:22:37 -05:00
Bruce Pennypacker
9cbe3eb8ae
Added support for 'REQUIRE SSL' grant option
2016-12-08 11:22:37 -05:00
Jonathan Mainguy
13990e9479
adds error message if socket does not exist
2016-12-08 11:22:35 -05:00
Petros Moisiadis
63b18ae618
mysql_user: Added missing privileges
...
Added missing privileges 'CREATE TABLESPACE' and 'PROXY' (see: http://dev.mysql.com/doc/refman/5.5/en/privileges-provided.html ).
2016-12-08 11:22:32 -05:00
Andrew Shults
2390184084
Strip white space to support multiline permissions in YAML
2016-12-08 11:22:32 -05:00
Toshio Kuratomi
ddc81c7b93
Escape % in db+table names before adding to a format string being passed into db.execute()
...
Fixes #416
2016-12-08 11:22:29 -05:00
Toshio Kuratomi
5734838cd1
Fix module traceback instead of returning an error
2016-12-08 11:22:29 -05:00
Toshio Kuratomi
47b009b001
Add a bare grant to the list of allowed privileges
2016-12-08 11:22:28 -05:00
Toshio Kuratomi
bed60553ca
Escape mysql identifiers
2016-12-08 11:22:28 -05:00
Michael DeHaan
5d814d9fb2
Some more module categorization.
2016-12-08 11:22:25 -05:00