Commit graph

22 commits

Author SHA1 Message Date
Laurent Indermühle
9057637844
mysql_info - add table count to the databases returned values (#691)
* Add tables count per database
* Add integrations tests
* Deduplicate tests between main and new task file
2024-11-19 08:51:03 +01:00
Andrew Klychkov
90bd0b0a75
Update contributor's email (#684) 2024-10-24 10:57:36 +02:00
Laurent Indermühle
cd9f4fcf57
Fix deprecated options from MySQL 8.2 (#662)
* Fix show master status for MySQL 8.2+

* Fix mysqldump option form --master-data to --source-data

* Fix incompatibility between mysqldump 8.0 and MySQL 8.4

Installing the same version between the client and the server makes
sense anyway. The incompatibility arise when you use mysqldump with
--source-data. The the tool tries to perform a SHOW MASTER STATUS which
is deprecated in MySQL 8.2+.

* Fix missing condition

* Fix unit tests

* Add a query resolver depending on implementation and version

* Sanity

* Fix SHOW REPLICA STATUS queries

* Fix mariadb's SHOW REPLICA HOSTS query

* Fix CHANGE MASTER for MySQL 8.0.23+

* Fix integration test for CHANGE MASTER

* Fix integration test for CHANGE MASTER

* Fix replication queries for MySQL 8.0.23+ and 8.4+

* Revert file edited by mistake

* Enhance tests format
2024-08-05 08:55:18 +02:00
Andrew Klychkov
83ed4af4e1
Deprecate mysqlclient/MySQLdb connector support (#655)
* Deprecate mysqlclient/MySQLdb connector support

* Update README

* Put in README that mysqlclient is deprecated
2024-07-09 08:20:47 +02:00
Laurent Indermühle
33e8754c4e
Fix mysql_user on_new_username IndexError (#642)
* fix tuple indexerror when no accounts are found

* Fix tests for update_password not executed

* Add test for case where existing user have different password

* lint to prevent warning about jinja templating in when clause

* Refactor get_existing_authentication to return a list of all row found

Previously we were returning only the first row found. We need to be
able to see if there is a difference in the existing passwords.

* Refactor host option to be optional

This make it possible to use the same method from mysql_user to help
update_password retrieve existing password for all account with the same
username independently of their hostname. And from mysql_info to get
the password of a specif user using WHERE user = '' AND host = ''

* Add change log fragment

* Add link to the PR in the change log

* lint for ansible devel

* Fix templating type error could not cconvert to bool with ansible devel

* Revert changes made for ansible-devel that broke tests for Ansible 2.15

* Revert changes made for ansible-devel that broke tests

* Cut unnecessary set, uniqueness is ensured by the group_by in the query

* Cut auth plugin from returned values when multiple existing auths exists

Discussed here:
https://github.com/ansible-collections/community.mysql/pull/642/files#r1649720519

* fix convertion of list(dict) to list(tuple)

* Fix test for empty password on MySQL 8+
2024-06-27 22:12:01 +02:00
Andrew Klychkov
f266ba59c9
mysql_info: add server_engine return value (#649)
* mysql_info: add server_engine return value

* Incorporate feedback
2024-06-19 10:17:02 +02:00
Robert Silén
6c4dca4bce
mention MariaDB (#640)
* mention MariaDB

* mention MariaDB in descriptions and notes

* nits

* chmod -x
2024-05-31 09:14:43 +02:00
Laurent Indermühle
47710cfb93
Enhance support of tls_requires in mysql_user and mysql_info (#628)
* fix option name

* Add tests for users using SSL

* Rewrite get_tls_requires using mysql.user table

* Add tls_requires to users_info filter

* add more consistant test users

* Add tls tests users in cleanup task

* Fix tls_requires data structure inconsistencies between modules

* Refactor user implementation to host get_tls_requires

* fix MySQL tls_requires not removed from user passed as empty

* Fix wrong variable used to return a hashed password

* Fix sanity

* fix unit tests

* Add changelog fragment

* Add PR URI to the changelog

* Add more precise change log

* fix documentation using wrong variable as an example

* Document example returned value `tls_requires` from users_info filter

* Revert changes that will be in a separate PR

* Fix sanity
2024-04-16 10:52:24 +02:00
Andrew Klychkov
e34209b3f8
Fix sanity issues (#609)
* Fix sanity issues

* Remove ignore entries
2024-01-23 11:27:47 +01:00
William Felipe Welter
852c19a78a
Using show all slaves status when using MariaDB to be consistent with MySQL (#602)
* Using `show all slaves status` whe using MariaDB to be consistent
with the MySQL behaviour.

* Fixing lint issues

* Fix issue by using dict attribute

* Fix unit tests

* fix lint test

* Add unit tests

* Fix unit tests

* Adding changlog fragment

* Update changelogs/fragments/602-show-all-slaves-status.yaml

Co-authored-by: Laurent Indermühle <laurent.indermuehle@pm.me>

* Refactoring change by moving common logic to the module_utils

* Fix sanity checks

* Fix sanity checks

* Adding lines to fix sanity checks

* Fixing sanity checks

* Update changelogs/fragments/602-show-all-slaves-status.yaml

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

* Removing is_mariadb and is_mysql functions

---------

Co-authored-by: Laurent Indermühle <laurent.indermuehle@pm.me>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2024-01-19 15:41:29 +01:00
Laurent Indermühle
3ef9bda95f
feat[mysql_info]: add 'users_info' filter (#580)
* add documentation for new mysql_info users_info filter

* Add integration tests for mysql_info users_info

* fix list parsing when cursor come from mysql_info

Mysql_info use a DictCursor and mysql_user a normal cursor.

* fix case when an account as same user but different host and password

* document why certain authentications plugins cause issues

* add version_added for users_info to the documentation

* Add 'users' description to differentiate it from 'users_info'

---------

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2023-10-23 11:26:46 +02:00
Pavel Rabel
b79fd94d51
Doc Attributes (#555)
* Added Attributes section

* Added Attributes section
2023-05-29 09:25:19 +02: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
3ff1fad5f3
Docs: change yes/no to true/false (#480) 2023-01-03 11:24:59 +01: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
a1f419d541
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
2021-08-20 08:17:34 +02: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
Andrew Klychkov
ea54a44c76
mysql_info: fix documentation (#67) 2020-11-26 13:12:51 +03:00
Jorge Rodriguez (A.K.A. Tiriel)
8c79011dbd
Disable hostname check (#38)
* Add changelog fragment

* Add check_hostname option

* Propagate check_hostname option across the collection

* Update documentation fragment

* Propagate test to all other plugins

* Remove stray line

* Give test user privileges to run test operations

* Extend integration tests job matrix

* Add caution note to documentation fragment.

* Update matrix job name

* Rearrange job matrix

* Fix sanity issues

* Fix issue with mysqldb silently failing to update out of range variables

* Fix variable overwrite

* Ignore `check_hostname` when using MySQLdb

* Update plugins/doc_fragments/mysql.py

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

* Update plugins/doc_fragments/mysql.py

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

* Update changelogs/fragments/35-disable-hostname-check.yml

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

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2020-10-12 21:19:43 +03:00
Andrew Klychkov
c255d7ece2
mysql modules: fix examples to use FQCN (#3) 2020-07-13 10:52:49 +01:00
Felix Fontein
4a3cfa6a32
Fixups (#2)
* Add changelog fragments from c.g.

* Adjust version_added to 0.1.0, which comes closer to the truth.

* Add changelogs/.plugin-cache.yaml to gitignore.
2020-07-12 12:35:55 +01:00
Ben Mildren
c26bc095ad
initial commit (#1)
* initial commit

* removed remaining references to community.general

* enabled integration pipeline

* switched from preconfigured replication topology to simple multinode install

* updated version from 1.0.0 to 0.1.0
2020-07-10 17:16:58 +01:00