Commit graph

62 commits

Author SHA1 Message Date
patchback[bot]
011bdbc2ef
Added formatting behaviour to documentation (#516) (#525)
* 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>
(cherry picked from commit 754387c7e5)

Co-authored-by: IBims1NicerTobi <54948543+IBims1NicerTobi@users.noreply.github.com>
2023-03-31 20:25:15 +02:00
patchback[bot]
62e2ed5d36
[PR #508/9b8455c2 backport][stable-1] Fix sanity (#510)
* Fix sanity (#508)

* Fix sanity

* Remove as unnecessary

(cherry picked from commit 9b8455c2e6)

* Update tests/unit/plugins/modules/test_mysql_user.py

---------

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2023-02-14 14:59:16 +01:00
patchback[bot]
cf25d85e49
[PR #497/a5f3296d backport][stable-1] mysql_info - Add connector_name and connector_version to returned value (#498)
* 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>
(cherry picked from commit a5f3296d73)

* Cut fragment not relevant to the collection usage

* Updated version_added for stable-1

---------

Co-authored-by: Laurent Indermühle <laurent.indermuehle@pm.me>
2023-02-01 09:47:44 +01:00
Andrew Klychkov
43a8037232
Docs: change yes/no to true/false (#480) (#482)
(cherry picked from commit 3ff1fad5f3)
2023-01-03 12:56:33 +01:00
patchback[bot]
2020870155
* add socket option suggestion in documentation (#437) (#454)
* * add `socket` option suggestion in documentation

* white space fix

* * move first two at the end

(cherry picked from commit b9a6ec4f7d)

Co-authored-by: Gabriel PREDA <eRadical@users.noreply.github.com>
2022-10-04 13:29:25 +02:00
Andrew Klychkov
c199000eee
Docs: add info how to cope with a protocol-related connection error using login_unix_socket argument (#420) (#431)
(cherry picked from commit f1d63e3fc8)
2022-08-26 13:41:06 +02:00
patchback[bot]
97be51ef45
Note added regarding the default config file, ~/.my.cnf (#400) (#402)
* Note added for https://github.com/ansible-collections/community.mysql/issues/394

* Update config file notes as discussed

* Update plugins/doc_fragments/mysql.py

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

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
(cherry picked from commit 0df46e0e67)

Co-authored-by: Chris Croome <chris@webarchitects.co.uk>
2022-06-17 08:27:00 +02:00
Andrew Klychkov
d8ab933d79
Update licensing information (#392) 2022-06-03 16:28:29 +02:00
patchback[bot]
89eb2d2fea
Changed += to append because cmd is a list (#377) (#386)
Using += on a list cause some problems druing creation of mysql command:
/usr/bin/mysql   - - u s e r = r o o t   - - p a s s w o r d = ' ' --socket=/run/mysqld/mysqld.sock

(cherry picked from commit 2e9d50f274)

Co-authored-by: Maciej <moledzki@users.noreply.github.com>
2022-06-01 07:58:16 +02:00
hubiongithub
4d4a5f2a02
merge into stable1 (#383)
* PR379 merge

* Update plugins/modules/mysql_user.py

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

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2022-05-31 17:43:15 +02:00
Andrew Klychkov
f7677aa05b
[stable-1] mysql_query: fix false change reports when IF NOT EXISTS clause is used (#375)
* mysql_query: fix false change reports when IF NOT EXISTS clause is used (#322)

* mysql_query: fix false change reports when IF NOT EXISTS clause is used

* Fix

* Fix doc, add fragment

* Improve doc

(cherry picked from commit 647461010d)

* Fix tests
2022-05-26 08:41:21 +02:00
Felix Fontein
f4736770e3
Add PSF-license.txt file (#356) (#359)
* Add PSF-license.txt file.

* Update with actual CPython 3.9.5 license.

(cherry picked from commit b2e476cb1a)
2022-05-17 08:24:07 +02:00
Andrew Klychkov
393023eb07
[stable-1] mysql_user: fix parsing privs when a user has roles assigned to it (#346)
* mysql_user: fix parsing privs when a user has roles assigned to it

* Fix CI

* Fix CI
2022-05-12 15:19:20 +02:00
Andrew Klychkov
256817ca32
Drop support for Ansible 2.9 and ansible-base 2.10 (#347) 2022-05-12 14:11:36 +02:00
Andrew Klychkov
b730cd6675
mysql_user: added flush privileges to write dynamic privs into db (#340) 2022-04-29 17:52:07 +02:00
Andrew Klychkov
278337d34f
[stable-1] Backports (#325)
* Clarified error message about missing python modules (#279)

* Clarified error message about missing python modules, and tweak documentation to suggest overriding interpreter.

* Mention mysqlclient as another option

* Correct mysqlclient suggestions from python2 to python3

Co-authored-by: Matthew Exon <git.mexon@spamgourmet.com>
(cherry picked from commit 82baf7508c)

* Copy ignore-2.13.txt to ignore-2.14.txt (#323)

* Copy ignore-2.13.txt to ignore-2.14.txt

* Fix sanity

(cherry picked from commit c16b2428e8)

Co-authored-by: Matthew Exon <github2.mexon@neverbox.com>
2022-04-02 17:33:52 +02:00
patchback[bot]
d5a1e3639a
mysql_user: clarify behavior of priv parameter (#319) (#320)
(cherry picked from commit 5afae459dc)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2022-03-25 12:33:01 +01:00
Andrew Klychkov
59d411ac82
Add IF EXISTS clause to DROP USER statement (#309) 2022-03-15 15:43:09 +01:00
Andrew Klychkov
b0de252ce2
Update requirements (#302) 2022-03-15 13:53:20 +01:00
Andrew Klychkov
9386045797
[stable-1] Use vendored version of distutils.version (#274)
* Prepare for distutils.version being removed in Python 3.12 (#267)

* Prepare for distutils.version being removed in Python 3.12

* Update plugins/module_utils/version.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit d9e12b85ad)

* Use vendored version of distutils.version (#269)

* Use vendored version of distutils.version

* Correct fragment

* Update plugins/module_utils/version.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 9c575b4762)

* Add ignore-2.13.txt
2022-01-18 10:53:09 +01:00
Andrew Klychkov
dbcc7e7e60
[stable-1] mysql_info: fix TypeError failure when there are databases that do not contain tables (#209)
* mysql_info: fix TypeError failure when there are databases that do not contain tables (#205)

* mysql_info: fix TypeError failure when there are databases that do not contain tables

* Add changelog fragment

(cherry picked from commit a1f419d541)

* Fix sanity errors
2021-08-20 09:50:34 +02:00
Andrew Klychkov
64b06aa543
mysql_query: correctly reflect changed status in replace statements (#193) (#197)
* mysql_query: correctly reflect changed status in replace statements.

* Fix the wrong indent.

(cherry picked from commit 9055bb4c8c)

Co-authored-by: Tong He <68936428+unnecessary-username@users.noreply.github.com>
2021-08-10 15:38:37 +02:00
Andrew Klychkov
9c17158802
[stable-1] Doc commit backport (#196)
* Add CONTRIBUTORS file (#166)

(cherry picked from commit ac927fdb08)

* Add documentation for privs with functions and procedures (#169)

(cherry picked from commit 6bce48e771)

* Update README.md (#168)

* Update README.md

* Fix

* Add MAINTAINERS file

(cherry picked from commit 479edd81d1)

* Improve wording in README (#170)

* Improve wording in README

* Update README.md

Co-authored-by: Jorge Rodriguez (A.K.A. Tiriel) <jorge.rodriguez@tiriel.eu>

Co-authored-by: Jorge Rodriguez (A.K.A. Tiriel) <jorge.rodriguez@tiriel.eu>
(cherry picked from commit c909aa2182)

* Update REVIEW_CHECKLIST.md (#171)

(cherry picked from commit 2236110bae)

* README: add a note how people can complain (#172)

* README: add a note how people can complain

* Change

* Improve

* Update README.md

Co-authored-by: Jorge Rodriguez (A.K.A. Tiriel) <jorge.rodriguez@tiriel.eu>

Co-authored-by: Jorge Rodriguez (A.K.A. Tiriel) <jorge.rodriguez@tiriel.eu>
(cherry picked from commit be4e84a92a)

* README: fix typos (#174)

(cherry picked from commit 2a80c301a6)

* README.md: Add link to IRC (#175)

(cherry picked from commit 3335a95ba5)

* README.md, CONTRIBUTING.md: add links to the Maintainer guidelines (#179)

(cherry picked from commit 8fad3f85b8)

* Update README (#181)

(cherry picked from commit 6d9288d19b)

* Update README.md (#183)

* Update README.md

* Change IRC ref

(cherry picked from commit 69012a2eb9)

* README: fix link (#184)

(cherry picked from commit 8ab6ea7714)

* README: fix the channel name (#185)

(cherry picked from commit cd759924fd)

* CONTRIBUTING.md: replace the content with a link to Ansible contributing guidelines (#187)

(cherry picked from commit 56a214885a)

* Update README (#186)

* Update README

* Fix

* Fix

* Fix

* Fix

* Add Libera.Chat link

(cherry picked from commit adb201a795)

* fix typo (#190)

"optoin" -> "option"

(cherry picked from commit 596ba0cedb)

* Update README.md (#191)

* Update README.md

* Update README.md

(cherry picked from commit 6f02cb266a)

* Add MAINTAINING.md, update README.md (#192)

(cherry picked from commit 0fabb2b77a)

Co-authored-by: Alexander Skiba <ghostlyrics@gmail.com>
Co-authored-by: Baptiste Mille-Mathias <baptiste.millemathias@gmail.com>
2021-08-10 14:33:56 +02:00
Andrew Klychkov
fe8f3662eb
mysql: revert changes made in PR 116 (#153) (#156)
* mysql: revert changes made in PR 116

* Add changelog fragment

* Fix CI

* Fix CI

* Fix CI

* Update CI

* Fix CI

(cherry picked from commit 738343d64c)
2021-04-23 14:08:49 +02:00
Jorge Rodriguez (A.K.A. Tiriel)
dc522cc5d3
Deprecate REQUIRESSL privilege (#132)
* Deprecate REQUIRESSL privilege

* Add missing whitespace

* Fix according to PR review

* Fix conditional check

* Fix privilege string parsing

* Add unit tests for the new function

* Add integration tests

* Fix parentheses indentation

* Cover alternative error message

* Fix privileges

* Limit verification of access denied to pymysql connector

* Fix REQUIRE SSL verification tests
2021-04-10 07:01:15 +02:00
Norbert Varzariu
0bdf9e2ee7
update docs on check_hostname corresponding to mysqls cli --ssl switch (#123)
Signed-off-by: Norbert Varzariu <loomsen@gmail.com>
2021-03-21 21:30:28 +02:00
Jorge Rodriguez (A.K.A. Tiriel)
11958ec46a
Handle divergences between MySQL and MariaDB (#103)
* Initial attempt

* First functional approach

* Remove unused imports

* Add dychotomy handling for mysql_replication

* Fix cursor lookup

* Fix sanity tests

* Cleanup implementation conditional import

* Fix unit tests

* Fix conditional import to satisfy both sanity and integration tests

* Add changelog fragment
2021-03-16 09:15:19 +01:00
Sebastian Gumprich
a5ee4b3d1a
add mysql_full_version and suffix return variable (#115)
* add mysql_full_version and suffix return variable

add changelog fragment

* rephrase changelog fragment

* Update plugins/modules/mysql_info.py

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

* Add changes as per PR review

* Add tests for new suffix output parameter

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Jorge-Rodriguez <jorge.rodriguez@futurice.com>
2021-03-16 09:10:52 +02:00
Daniel Ziegenberg
2254b29178
change deprecated parameter pw and db (#116)
* change deprecated parameter pw to password

* change deprecated parameter db to database

* add changelog fragment
2021-03-16 07:15:12 +02:00
Andrew Klychkov
bd86e249d0
mysql_replication: add a reference to how to encrypted connection options (#118)
* mysql_replication: add a reference to how to encrypted connection options

* Fix sanity
2021-03-15 09:39:14 +01:00
Felix Fontein
884310cf24
Mark master_ssl_key as no_log=False. (#117) 2021-03-15 07:30:53 +01:00
Andrew Klychkov
baea97d24c
mysql_user: Add REPLICA MONITOR privilege to supported (#108)
* mysql_user: Add REPLICA MONITOR privilege to supported

* Add changelog fragment
2021-03-11 16:17:49 +01:00
Andrew Klychkov
979588e2cd
mysql_user: add proper handling of INSERT, UPDATE, REFERENCES on columns (#107)
* mysql_user: add proper handling of INSERT, UPDATE, REFERENCES on columns

* Add changelog fragment

* fix sanity

* fix CI

* fix sanity

* fix CI

* make the assertion fairer

* Improve
2021-03-08 17:18:04 +01:00
Andrew Klychkov
2694464ffb
mysql_user: when grant select on columns, the module always report the state has changed (#100)
* mysql_user: fix the module is not idempotent when there is SELECT on columns granted

* add changelog fragment

* fix

* Add unit tests for has_select_on_col function

* Add unit tests for sort_column_order function

* Add unit tests for handle_select_on_col function

* Update a comment
2021-03-03 10:58:57 +01:00
Andrew Klychkov
e8dc2f2476
mysql_replication: deprecation of slave related options, adding alternatives (#97)
* mysql_replication: deprecation of slave related options, adding alternatives

* Add changelog fragment

* Integration tests getslave -> getreplica

* Change the rest of offending choices/comments

* Add announcement about replacing SLAVE to REPLICA in messages

* Deprecate offending values
2021-03-01 10:45:35 +01:00
Tom Van Looy
24a4137982
mysql_user: remove duplicate of REPLICATION SLAVE entry from valid privs frozenset (#95) 2021-02-10 09:38:47 +03:00
Steve Teahan
b25fb5974d
mysql_user: refactor to reduce execute() calls (#76)
This module does not currently log the SQL statements that it executes.
A change was proposed to add this functionality, but it would require
modifications in many sections of the code due to how many cursor.execute()
statements there currently are. This change simply consolidates the
number of execute() calls where it is trivial to do so.
2021-01-15 13:44:03 +03:00
Steve Teahan
06907715d7
mysql_user: fixed encrypted option for MySQL 8.0 and test coverage (#79)
* mysql_user: fixed encrypted option for MySQL 8.0 and test coverage

The purpose of this change was originally to expand test coverage to
unblock #76, but an issue was detected with the encrypted parameter on
MySQL 8.0 in the process of writing the tests. Additionally,
user_password_update_test.yml had been disabled at some point, so I
opted to replace it with two new files that will focus on the password
and plugin auth paths.

* Updated tests to cover a couple of missing branches

* Skip tests that rely on sha256_password if pymysql < 0.9

* Cover the case where pymysql isn't installed for plugin tests

* Added better plugin auth checking to tests and other minor changes

* Fixed version detection to explicitly handle MariaDB

* Removed unneeded import from previous change

* Remove whitespace that was introduced by change that was removed

* Added unit tests for missing coverage
2021-01-14 08:27:05 +03:00
Andrew Klychkov
2de3a57021
mysql_user: Add SHOW_ROUTINE privilege support (#87)
* mysql_user: Add SHOW_ROUTINE privilege support

* add changelog fragment

Co-authored-by: Andrew Klychkov <andrew.klychkov@gmail.com>
2021-01-13 09:36:23 +03:00
Andrew Klychkov
ebe503823a
mysql_replication: fix crashes caused by deprecated terminology (#71)
* mysql_replication: fix crashes caused by deprecated terminology

* Fix unrelated sanity errors

* Tests: mysql 8.0.21 -> 8.022

* Adjust integration tests

* Add version check to the tests

* Add debug statement

* Adjust mysql version

* Fix tests

* Add unit tests

* Add changelog fragment

* Improve code and coverage

* Get rid of extra blank line

* Improve coverage

* Change suggested
2020-12-18 11:17:18 +03:00
Andrew Klychkov
b7e828a092
mysql_db: fix false warning related to unsafe_login_password (#74) 2020-12-18 10:56:49 +03:00
steveteahan
20f9699199
mysql_user: Fixed change detection with append_privs (#69) (#72)
* mysql_user: Fixed change detection with append_privs (#69)

Prior to this change, mysql_user with append_privs would attempt to make
a change even if the current privileges were a superset of the new
privileges (shouldn't require any action).

* Fixed unrelated mysql_replication doc causing failures in CI

* Added fragments and check_mode tests

* Expanded priv append tests to cover additional case
2020-12-16 08:22:00 +03:00
Andrew Klychkov
d309d5af2d
mysql_user: fix documentation (#65)
* mysql_user: fix documentation

* Changed suggested

* Update plugins/modules/mysql_user.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/mysql_user.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-11-26 13:51:02 +03:00
Andrew Klychkov
ea54a44c76
mysql_info: fix documentation (#67) 2020-11-26 13:12:51 +03:00
Andrew Klychkov
549c7fe15a
mysql_variables: fix documentation (#66) 2020-11-26 13:12:31 +03:00
Andrew Klychkov
504bc87a4a
mysql_db: improve documentation formatting (#64) 2020-11-26 13:12:11 +03:00
Jose Angel Munoz
bb99cf5b04
Add mysqlclient library reference in doc (#57) 2020-11-06 21:14:45 +03:00
Andrew Klychkov
2dcbd7846f
mysql_query, mysql_user: simple refactoring of type checks (#58)
* mysql_query: simple refactoring of query type check

* do the same for mysql_user

* Improve integration test coverage
2020-11-06 13:12:07 +03:00
Andrew Klychkov
b2bde48020
mysql_query: add note about running queries from file via mysql_db module (#55) 2020-11-05 13:29:24 +03:00
Andrew Klychkov
ae9c0a1751
mysql_query: fix failing when single-row query contains commas (#53)
* mysql_query: fix failing when single-row query contains commas

* add changelog fragment

* Improve documentation and tests

* Fix typo

* Improve test coverage

* Fix

* Remove the irrelevant note

* change suggested
2020-11-03 15:04:39 +03:00