Commit graph

267 commits

Author SHA1 Message Date
Andrew Klychkov
4912f1a41b
mysql_variables: fix boolean value handling (#653)
* mysql_variables: fix boolean value handling

* fix

* Fix tests

* Fix tests

* Fix

* Fix

* Fix

* Fix comment
2024-06-28 11:34:59 +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
Laurent Indermühle
1922e7154e
[CI] Remove ansible-test custom containers (#650)
* Cut tests containers

* Cut unused flatten versions

* Fix installation of mysqlclient on Ubuntu

* Cut unused variables

* Fix package missing on Unbuntu 22.04

* Fix variable templating

* Fix test for ansible 2.17 and do remove the ignore_errors

ignore_errors is bad because it makes searching for real errors
difficult.
2024-06-24 09:36:32 +02:00
Andrew Klychkov
aafe658a85
Update README.md (#648) 2024-06-19 10:20:34 +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
Matthieu Bourgain
0bc3e3d848
Add salt parameter to hash generation for sha256 plugins (#631)
* add salt parameter to hash generation for sha256 plugin
* technomax review modification
* no general user test for salt
2024-06-11 17:23:05 +02:00
Laurent Indermühle
50e7413b88
Fix hashed passwords being returned by get_existing_authentication() via the plugin_auth_string variable instead of plugin_hash_string (#629)
* fix returned variable from plugin_auth_string to plugin_hash_string
* Refactor to keep plugin_auth_string in addition to plugin_hash_string
* Add breaking_changes to the changelog
2024-06-06 13:05:31 +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
Dennis Felipe Urtubia
47610347ba
Adds support for show binary log status statement (#638)
* feat: adds support for show binary log status statement

* feat: adds support for mariadb show binlog status statement
2024-05-30 17:10:36 +02:00
Dennis Felipe Urtubia
a80b805619
Adds support for CHANGE REPLICATION SOURCE TO statement (#636)
* feat: adds support for 'change replication source to' statement
2024-05-21 20:58:05 +02:00
Laurent Indermühle
6ce2f49f96
Improve get replica/primary status (#634)
* Fix case where a failed fetchone() still return a dict

* Fix test for MariaDB

* fix case where  a failed fetchone() still return a dict for primary

* Add changelog fragment
2024-05-02 10:26:04 +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
Laurent Indermühle
0618ff6c41
Fix sanity tests for ansible-core 2.18 (#627) 2024-04-12 09:00:43 +02:00
Laurent Indermühle
f105fd9a95
Add tests for Ansible core 2.17 (devel is 2.18 today) and bump tests dependencies (#623)
* Add tests for Ansible core 2.17 (devel is 2.18 today)

* Drop tests for Ansible core 2.14 and add 2.17

* Cut duplicate exclude

* Add back python 3.8 and 3.9 for stable2.15

* Bump action to prevent deprecation warnings

* Cut python 3.9 for devel in roles tests

* Attempt to fix GHA line folding

* fix typo

* Bump ubuntu

Latest ansible-test doesn't work with old ubuntu. See here for more
info: https://github.com/ansible-collections/collection_template/blob/main/.github/workflows/ansible-test.yml#L83-L91

* fix docker_image var assignation

* fix yamllint false positive

* Attempt to fix docker_image_multiline assignation

* Fix empty var due to scope of each command

* Attempt to fix docker_image assignation

* fix error "vars should be dict"

* Document URL of the repository for the action ansible-test-gh-action

* Disable role tests

* Document ansible-core version tested

* Cut ansible-core 2.14 from testing documentation
2024-04-11 10:46:43 +02:00
Andrew Klychkov
bfe2fdc3ff
mysql_user: fix ed25512 plugin handling (#619) 2024-03-14 07:19:39 +01:00
Andrew Klychkov
c99c19a489
README.md: update Communication guide (#617) 2024-02-27 10:27:19 +01:00
Andrew Klychkov
52a11d7235
Release 3.9.0 commit (#616) 2024-02-22 10:53:01 +01:00
tompal3
40af258d86
password_expire support for mysql_user (#598)
* initial commit for password_expire support

* sanity check and default values

* add one more if block for version check

* some changes and integration tests

* docs and sanity and integration test fix

* make integration tests work

* make integration tests work

* fix unneeded commits

* fix verify as well

* Update plugins/modules/mysql_user.py

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

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

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

* Apply suggestions from code review

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

* Update plugins/modules/mysql_user.py

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

* Update plugins/modules/mysql_user.py

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

* Update plugins/modules/mysql_user.py

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

* Update plugins/modules/mysql_user.py

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

* Update plugins/module_utils/user.py

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

* Update plugins/module_utils/user.py

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

* Update plugins/module_utils/user.py

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

* typo and no_log remove for password_expire* vars

* add change log fragment

* move one if statement to module initialiazation

* fix merge conflicts

* fix order

* some fixes

* set no_log to true for password word containing keys

* fix sanity error

* Update changelogs/fragments/598-password_expire-support-for-mysql_user.yml

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

---------

Co-authored-by: Laurent Indermühle <laurent.indermuehle@pm.me>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2024-02-22 10:31:01 +01:00
Andrew Klychkov
21fe52d8f1
CONTRIBUTING.md: add a detailed guide (#615) 2024-02-22 10:19:08 +01:00
Andrew Klychkov
32718ca295
Update MAINTAINERS file (#612) 2024-01-25 07:55:51 +01:00
Andrew Klychkov
e34209b3f8
Fix sanity issues (#609)
* Fix sanity issues

* Remove ignore entries
2024-01-23 11:27:47 +01:00
Andrew Klychkov
5ed3eaf3ee
Version 2.*.* is EOL (#605) 2024-01-19 15:51: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
ncc
051aa48d8d
feat[mysql_user]: add support for mysql user attributes (#604)
* add support for mysql user attributes

* fix CI

* write integration tests

* requested changes pt. 1

* requested changes pt. 2

* fix changelog fragment

---------

Co-authored-by: n-cc <ncc@github.com>
2024-01-19 15:37:28 +01:00
Laurent Indermühle
81ab18d56c
chore: fix conditional statements should not include jinja 2 templating (#599)
Thanks to @tompal3 for your contribution
2023-11-30 13:39:34 +01:00
Andrew Klychkov
8dfab12bae
README: Add forum info (#589) 2023-11-13 12:35:39 +01:00
Laurent Indermühle
0dbedf57cb
Document MySQL and MariaDB don't store roles with same manner (#584) 2023-10-26 14:21:28 +02:00
Laurent Indermühle
fd0b1919c3
Release 3.8.0 commit (#583) 2023-10-26 11:08:35 +02:00
Laurent Indermühle
f31d5a10c1
fix list of tested ansible-core versions (#582) 2023-10-25 15:11:40 +02: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
lkthomas
6b7cc14989
switch "PRIMARY" to "MASTER" on description (#573)
* switch "PRIMARY" to "MASTER" on description

* Update plugins/modules/mysql_replication.py

* Add author to contributors lists

---------

Co-authored-by: Thomas Lau <lkthomas@localhost.localdomain>
Co-authored-by: Thomas Lau <thomas.lau@gfo-x.com>
2023-10-12 13:50:54 +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
Laurent Indermühle
8c2b6b0b3c
Add ansible-core stable-2.15 and stable-2.16 to tests matrix now that "devel" links to 2.17 (#574)
* Add stable-2.15 and 2.16 now that devel link to 2.17

* document which ansible-core version we support

* add sanity ignore for ansible-core 2.17

* cut sanity ignore for 2.12 and 2.13

* Cut ansible-core 2.12 and 2.13 from GHA test matrix
2023-09-29 09:29:43 +02:00
Andrew Klychkov
94392826e1
README: Define project's mission statement (#561)
* README: Define project's mission statement

* Add suggestion
2023-07-20 09:57:51 +02:00
Pavel Rabel
b79fd94d51
Doc Attributes (#555)
* Added Attributes section

* Added Attributes section
2023-05-29 09:25:19 +02:00
Andrew Klychkov
a81b6fc081
Release 3.7.2 commit (#556) 2023-05-25 13:30:17 +02:00
betanummeric
2fcfb103f6
fix tests (include deprecation) (#554)
* tests: change deprecated "include" to "include_tasks"

* tests: fix syntax

---------

Co-authored-by: Felix Hamme <felix.hamme@ionos.com>
2023-05-24 10:00:47 +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
Andrew Klychkov
bff05ce8dd
Release 3.7.1 commit (#552) 2023-05-22 09:34:59 +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
b03c9aac57
Document the Releases Support Timeline (#543)
* docs: add releases support timeline

* docs: clarify when the 2 years of support starts

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

* docs: fix support status of the current branch

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

* docs: fix date to end of support for branch 2.x.y

* fix README.md

---------

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: betanummeric <40263343+betanummeric@users.noreply.github.com>
2023-05-10 13:10:20 +02:00
Andrew Klychkov
bd90ce7cc6
MAINTAINERS: add new maintainer (#548) 2023-05-10 12:54:25 +02:00
Laurent Indermühle
04e197fe55
Release 3.7.0 commit (#544) 2023-05-05 13:32:40 +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
Laurent Indermühle
426084a131
Fix the Makefile for integration tests not using the Python Venv (#532)
* Fix venv not being used by keeping the same shell

Also fix "-set -x" command not found.

* Fix missing option in the command usage documentation

* Document connector-version relationship

* Fix missing option in the command usage documentation

* Rephrase commands descriptions

* Document that you need to kill the ansible-test container yourself
2023-04-25 16:19:41 +02:00
Andrew Klychkov
9124b1f575
Copy ignore.txt for the devel branch (#529) 2023-04-07 13:36:27 +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
Laurent Indermühle
21e42b5777
Add filter to prevent rebuild container on push on stable-(1|2) (#522) 2023-03-31 13:48:41 +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
Laurent Indermühle
e2aa655762
Fix issues and documentation with integration tests after merge of #490. (#514)
* Fix explanation about containers images
* Add definitive URI to the containers images
* Document that new images must be set as public
* Add makefile options possible values
* Document that any mysql and mariadb tag can be use
* Add computation of docker_image path
* Refactor pre-command to separate commands for cleaner GHA output
* Refactor to use GHA test matrix
* Cut docker_image from documentation since it's now automatic
* Document how to use run_all_test.py to display the test matrix
* Temp: Add path to images in my fork to validate integrations tests
2023-03-24 10:16:36 +01:00