Commit graph

134 commits

Author SHA1 Message Date
Laurent Indermuehle
0c17778f63
document better description 2023-10-11 16:51:46 +02:00
Laurent Indermuehle
2ea7120f2e
document output form 2023-10-11 16:51:46 +02:00
Laurent Indermuehle
2acc3d2a77
document what's missing from the output 2023-10-11 16:51:46 +02:00
Laurent Indermuehle
487036e2ff
add set to work no matter the order 2023-10-11 16:51:46 +02:00
Laurent Indermuehle
5dd0321607
add filter to return an auth key when not empty 2023-10-11 16:51:46 +02:00
Laurent Indermuehle
83ad999038
document returned value 2023-10-11 16:51:45 +02:00
Laurent Indermuehle
c1248cb692
cut unused option (will be in authentications.auth_string) 2023-10-11 16:51:45 +02:00
Laurent Indermuehle
093fe79e17
add missing option (forgotten in previous commit) 2023-10-11 16:51:45 +02:00
Laurent Indermuehle
6123d77b99
fix malformed SQL query 2023-10-11 16:51:45 +02:00
Laurent Indermuehle
eb840f6ae4
WIP: get user authentications plugins 2023-10-11 16:51:45 +02:00
Laurent Indermuehle
bd944f7bf9
add host in case multiple accounts uses the same username 2023-10-11 16:51:45 +02:00
Laurent Indermuehle
fa6eded000
fix KeyError 0 2023-10-11 16:51:45 +02:00
Laurent Indermuehle
9f34b926bf
fix returned value since get_resource_limit is used by other methods 2023-10-11 16:51:45 +02:00
Laurent Indermuehle
1c93c1bd66
Add user resources limit to the output 2023-10-11 16:51:44 +02:00
Laurent Indermuehle
248b30cad6
fix get_resource_limit to work with MariaDB and MySQL
I was getting KeyError 0
2023-10-11 16:51:44 +02:00
Laurent Indermuehle
089e1c3fb1
add a get_server_type module_utils method to detect MySQL vs MariaDB 2023-10-11 16:51:44 +02:00
Laurent Indermuehle
1e24343375
Fix USAGE line not filtered 2023-10-11 16:51:44 +02:00
Laurent Indermuehle
3288c22e64
fix quote around special priv Proxy for root on `@%` 2023-10-11 16:51:44 +02:00
Laurent Indermuehle
cf4c230725
Add the privileges in the returned values 2023-10-11 16:51:44 +02:00
Laurent Indermuehle
2054241920
Fix KeyError 0 2023-10-11 16:51:43 +02:00
Laurent Indermuehle
123b73aa3f
attempt to fix KeyError 0 in privileges_get 2023-10-11 16:51:43 +02:00
Laurent Indermuehle
028089da6d
attempt to use privileges_get 2023-10-11 16:51:43 +02:00
Laurent Indermuehle
7f2f141275
revert changes to get_grants() 2023-10-11 16:51:43 +02:00
Laurent Indermuehle
31a5eb8739
Debug error "0"
This debug output this:

[
  {'Grants for root@localhost': \"GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION\"},
  {'Grants for root@localhost': \"GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION\"}
],
[
  {'Grants for mysql.session@localhost': \"GRANT SUPER ON *.* TO 'mysql.session'@'localhost'\"},
  {'Grants for mysql.session@localhost': \"GRANT SELECT ON `performance_schema`.* TO 'mysql.session'@'localhost'\"},
  {'Grants for mysql.session@localhost': \"GRANT SELECT ON `mysql`.`user` TO 'mysql.session'@'localhost'\"}
 ],
 [
   {'Grants for mysql.sys@localhost': \"GRANT USAGE ON *.* TO 'mysql.sys'@'localhost'\"},
   {'Grants for mysql.sys@localhost': \"GRANT TRIGGER ON `sys`.* TO 'mysql.sys'@'localhost'\"},
   {'Grants for mysql.sys@localhost': \"GRANT SELECT ON `sys`.`sys_config` TO 'mysql.sys'@'localhost'\"}
 ],
 [
   {'Grants for root@%': \"GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION\"}
 ]

 I think something is wrong in the lambda and when grants art on ''@''.
2023-10-11 16:51:43 +02:00
Laurent Indermuehle
d7beeec410
WIP attempt to retrieve all users privileges 2023-10-11 16:51:42 +02:00
kmarse
033b4c74f9
Fix column uppercasing (#569)
* Add integrations tests for column case sensitive name

* add a warning when column_case_sensitive in not set

* add announce default will change in in 4.0.0

* fix tests for engine that don't wrap column in backticks

* add filter because only MySQL 5.7 is case sensitive for users privs

* add kmarse and myself to the authors

* add kmarse to the contributors list

---------

Co-authored-by: Laurent Indermühle <laurent.indermuehle@epfl.ch>
Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2023-10-06 16:08:46 +02:00
Pavel Rabel
b79fd94d51
Doc Attributes (#555)
* Added Attributes section

* Added Attributes section
2023-05-29 09:25:19 +02:00
betanummeric
b6ad472c78
fix connection arguments for MySQLdb <2.0 !=1.0 (#553)
* fix connection arguments for MySQLdb <2.0 !=1.0

* add changelog fragment

---------

Co-authored-by: Felix Hamme <felix.hamme@ionos.com>
2023-05-23 15:32:21 +02:00
betanummeric
7f7b2f76a6
fix connection arguments mysql driver compatability (#551)
* only use the "database" connection argument with driver versions where "db" is deprecated/removed

* connection arguments: fix KeyError

* connection arguments: fix KeyError

* connection arguments: use 'passwd' instead of 'password' with older drivers

* add changelog fragment

* refactoring: use "get_connector_name" in "mysql_connect"

---------

Co-authored-by: Felix Hamme <felix.hamme@ionos.com>
2023-05-18 09:28:34 +02:00
Laurent Indermühle
30a2015f6c
feat: Add support for the connector pymysql 1.0.2 (#533)
* Document connector-version relationship

* Fix missing option in the command usage documentation

* Rephrase commands descriptions

* Document that pymysql 0.10.0 disabled its warnings

* Disable tests for pymysql newer than 0.10.0 because the behavior changed

* Enable integration tests for pymysql 1.0.2

* Add exclusion to avoid requesting nonexistent test containers

* Cut comments about PyMySQL 1.0.2 need to be fixed

* docs: explain PyMySQL 0.10.0+ returns changed when using IF EXISTS
2023-05-04 11:14:58 +02:00
Maximilian Stinsky
526e674e6f
Add MAX_STATEMENT_TIME resource limit (#523)
* Add MAX_STATEMENT_TIME to resource_limits

* Move version check for resource_limits to implementations
2023-04-07 10:20:49 +02:00
IBims1NicerTobi
754387c7e5
Added formatting behaviour to documentation (#516)
* Added formatting behaviour to documentation

* Update plugins/modules/mysql_query.py

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>

---------

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2023-03-31 13:27:48 +02:00
Andrew Klychkov
9b8455c2e6
Fix sanity (#508)
* Fix sanity

* Remove as unnecessary
2023-02-14 09:57:44 +01:00
Daniel Ziegenberg
2f151dc8f4
change deprecated parameter pw and db (#177)
* change deprecated parameter pw to password

* change deprecated parameter db to database

* add changelog fragment

* Old plugin versions are no longer supported

* Use packaging version checking.

* Use stdlib version comparison

* Use parse_version from setuptools

* Revert to tuple/reduce version check

---------

Co-authored-by: Jorge-Rodriguez <jorge.rodriguez@futurice.com>
2023-02-10 09:47:12 +01:00
Markus Bergholz
b34c23d07d
Fix revoke only grant (#503)
* fix

* test

* changelog
2023-02-08 09:24:35 +01:00
Paul Campbell
521443a671
Allow uppercase in variable names for Galera wsrep variables (#501)
* Allow uppercase in variable names for Galera wsrep variables

* Changelog fragment for regex change

* Corrected for excessive line lengths

* Update changelogs/fragments/mysql_variables_allow_uppercase_identifiers.yml

---------

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2023-02-04 08:31:00 +01:00
Alexander Skiba
b8d6474540
mysql_role: enable autocommit (#500)
* mysql_role: enable autocommit

* Add changelog fragment
2023-02-01 09:37:37 +01:00
Laurent Indermühle
a5f3296d73
mysql_info - Add connector_name and connector_version to returned value (#497)
* Add methods to retrieve connector name and version
* Document that mysqlclient is also named MySQLdb
* Document version_added
* Add connector name and version in the returned block
* Cut condition to display any name that is return

In case of MySQLdb is renamed in mysqlclient. In that case, the
integration tests will catch this the day we update the connector
version.

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2023-01-30 13:35:24 +01:00
Andrew Klychkov
930a5a5d49
mysql_user: add session_vars argument (#489)
* mysql_user: add session_vars argument

* Update tests/integration/targets/test_mysql_user/tasks/main.yml

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2023-01-24 14:53:29 +01:00
Alexander Skiba
c242584bae
mysql_user: enabled autocommit to support MySQL 8 (#483)
* mysql_user: enabled autocommit to support MySQL 8

* Add changelog fragment

* Link to issue instead of pull request in changelog fragment

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2023-01-17 10:34:20 +01:00
Andrew Klychkov
3ff1fad5f3
Docs: change yes/no to true/false (#480) 2023-01-03 11:24:59 +01:00
hubiongithub
8a579b42e3
add service name to plugin pam/auth_pam usage (#445)
* add service name to plugin pam/auth_pam usage

* typo fixed

* MySLQ is using identified with auth_pam by ...  instead of identified with pam using ... like mariadb does

* a : in description lines breaks yaml syntax

* clearify documentation and add changelog fragment

* Update changelogs/fragments/445_add_service_name_to_plugin_pam_auth_pam_usage.yml

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>

* Update plugins/module_utils/user.py

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2023-01-03 09:47:11 +01:00
Diego Gullo
6ac89ca1f6
Display a more informative error when InvalidPrivsError is raised (#465) (#466)
* Display a more informative error when InvalidPrivsError is raised (Issue #465)

Co-authored-by: Laurent Indermühle <laurent.indermuehle@pm.me>
2022-12-06 13:12:01 +01:00
Gabriel PREDA
b9a6ec4f7d
* add socket option suggestion in documentation (#437)
* * add `socket` option suggestion in documentation

* white space fix

* * move first two at the end
2022-10-04 11:08:59 +02:00
R.Sicart
2d75bc19b8
Fix privilege changing everytime (#438)
* Compare privileges from before and after manipulation

* Add unit tests

* Fix FIXME integration tests related to this issue

* Fix sanity check

* Fix assertion when appending privs in mysql_role_initial integration tests

* Fix pylint

* [ci-skip] Add changelog fragment

* Fix: missing fragment file extension

* Replace privileges_equal() by a comparison

* Fix: sanity pylint

* Fix: forgot to remove privileges_equal import from unit tests
2022-09-08 18:26:58 +02:00
R.Sicart
cc5cf98368
Fix: grant revoked priv (#434)
* Fix: exclude mysql 8 from test_mysql_user's 'Assert that priv did not change' test

* Add tests to verify that GRANT permission is present after user modification

* Fix: do not revoke GRANT permission when it's already allowed and present in priv parameter

* Deduplicate tests name

Easier to debug this way

* Fix assertions named 'GRANT permission is present'

* Only revoke grant option if it exists and absence is requested

* Fix assertion comments

* Fix: Only revoke grant option if it exists and absence is requested

* Avoid pointless revocations when ALL are granted

* Assert that priv did not change on mariadb also

* Fix: sanity and unity tests

* Format long lines

* Add changelog fragment

Co-authored-by: Laurent Indermühle <laurent.indermuehle@pm.me>
2022-09-02 13:40:06 +02:00
Андрей Неустроев
aef6a2040c
Add SOURCE_SSL_VERIFY_SERVER_CERT parameter (#435)
* Add SOURCE_SSL_VERIFY_SERVER_CERT parameter

* Rewiev fixs and add changelog fragment

* fix version

* Update changelogs/fragments/435-mysql_replication_verify_server_cert.yml

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2022-09-02 10:59:51 +02:00
Andrew Klychkov
f1d63e3fc8
Docs: add info how to cope with a protocol-related connection error using login_unix_socket argument (#420) 2022-08-26 11:38:41 +02:00
Andrew Klychkov
1776702b9d
Announce pipefail default change in community.mysql 4.0.0 (#408) 2022-06-30 11:38:21 +02:00
Laurent Indermühle
5108ca5e66
Fix mysqldump ignoring errors (#403)
* Add schema and tables for the tests

* Add tests for full dump with and without compression

* Add test for distinct dump with and without compression

* Fix sh not seeing errors for command before the pipe

sh is missing the pipefail flag. We must use bash for this.

* Add cleanup to prevent the following tests from failing

* Fix fqcn in module_defaults

* Add changelog fragment

* Add check to the error message to ensure we captured the right one

* Add option to activate the fix on systems with bash

* Fix errors when data schema is already absent

* Update changelogs/fragments/fix-256-mysql_dump-errors.yml

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>

* Add markup for commands in the documentation string

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>

* Add markup and next release version in the documentation string

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>

* Fix missing dependency for MySQL 8

* Add pipefail to tests of uncompressed dumps to enure it still works

* Fix "bash command not found" if pipefail is used for uncompressed dump

* Fix sanity pep8

* Document example of dump with pipefail

* Add dedpulication to command construct

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2022-06-30 06:54:26 +02:00