Commit graph

141 commits

Author SHA1 Message Date
Laurent Indermühle
58b850f217
[PR #427/0a68bb27 backport][stable-2] CI is changed (#429)
* Is changed (#427)

* Refactor tests to use "is" and "is not" changed

* Refactor tests to use is succeeded or is failed

* Reformat indentation

* Add filter "bool" to prevent issues

(cherry picked from commit 0a68bb270f)

* Fix error message verification

I don't know why this works on main, but in stable-1, the error message
is "invalid privileges string: Invalid privileges specified:
frozenset({'INVALID'})"

* Add filter for test that won't work with mariadb

* Add test databases cleanup

* Backport small diff from main
2022-08-29 10:20:13 +02:00
patchback[bot]
4aa166ec13
Docs: add info how to cope with a protocol-related connection error using login_unix_socket argument (#420) (#430)
(cherry picked from commit f1d63e3fc8)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2022-08-26 13:08:42 +02:00
Laurent Indermühle
8968f51533
Port stable 1 ci changes (#423) (#424)
* Add changes from stable-1 integrations tests (PR 418)

* Refactor to use connectors' info declared in setup_mysql

* Fix 2nd replication stop marked changed by mysqlclient

(cherry picked from commit 61586ae4cc)
2022-08-17 11:30:34 +02:00
patchback[bot]
13a8a4ebff
MAINTAINERS file: add a new maintainer (#419) (#421)
(cherry picked from commit 057f817111)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2022-08-13 21:37:22 +02:00
patchback[bot]
912995da76
Fix ci python requirements (#416) (#417)
* Add matrix for python and ansible-core versions for sanity tests

* Add python 3.9 to integrations tests

* Add python 3.9 to unit tests

* Reformat sort by python version first

(cherry picked from commit 97318559e5)

Co-authored-by: Laurent Indermühle <laurent.indermuehle@pm.me>
2022-08-09 08:17:00 +02:00
Laurent Indermühle
98d4828e44
Update galaxy.yml to the next expected version (#413) 2022-08-03 10:30:06 +02:00
Laurent Indermühle
b642aedc25
Release 2.3.9 commit (#411) 2022-08-02 10:24:25 +02:00
patchback[bot]
a444d0a356
README: update MariaDB versions we test against (#404) (#405)
(cherry picked from commit 6f87620d9b)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2022-06-24 15:07:20 +02:00
patchback[bot]
cac58cfa49
Note added regarding the default config file, ~/.my.cnf (#400) (#401)
* 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:08 +02:00
patchback[bot]
404ffbb3b1
Update licensing information (#390) (#391)
(cherry picked from commit 2a3f8f6506)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2022-06-03 16:28:20 +02:00
Andrew Klychkov
71c7275fef
Release 2.3.8 commit (#388) 2022-06-02 08:18:36 +02:00
patchback[bot]
9ca52b3aa5
Changed += to append because cmd is a list (#377) (#385)
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:57:56 +02:00
Andrew Klychkov
0a40c13aa8
mysql_user: prevent password getting set for existing users on on_cre… (#342) (#382)
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
(cherry picked from commit 51a38840d9)

Co-authored-by: hubiongithub <79990207+hubiongithub@users.noreply.github.com>
2022-05-31 14:32:23 +02:00
patchback[bot]
0011798382
mysql_query: fix false change reports when IF NOT EXISTS clause is used (#322) (#374)
* 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)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2022-05-25 19:58:15 +02:00
Andrew Klychkov
46dc308e28
mysql_role - don't add members to a role when creating the role and detach_members true is set (#372)
Co-authored-by: betanummeric <40263343+betanummeric@users.noreply.github.com>
2022-05-25 16:22:39 +02:00
patchback[bot]
e34cfba109
mysql_role: fix and simplify role member detection (#368) (#371)
* mysql_role: fix and simplify role membership detection

* add changelog fragment

* Update changelogs/fragments/368-mysql_role-fix-member-detection.yml

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

Co-authored-by: Felix Hamme <felix.hamme@ionos.com>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
(cherry picked from commit 07a72865f7)

Co-authored-by: betanummeric <40263343+betanummeric@users.noreply.github.com>
2022-05-25 14:36:08 +02:00
Andrew Klychkov
c02e46e7b0
Release 2.3.7 commit (#362) 2022-05-17 12:15:07 +02:00
Felix Fontein
cf1c95b64d
Add PSF-license.txt file (#356) (#360)
* Add PSF-license.txt file.

* Update with actual CPython 3.9.5 license.

(cherry picked from commit b2e476cb1a)
2022-05-17 08:24:28 +02:00
Andrew Klychkov
65b1773ed0
Release 2.3.6 commit (#354) 2022-05-13 09:16:09 +02:00
Andrew Klychkov
f854fc96db
Drop support for Ansible 2.9 and ansible-base 2.10 (#343) (#348)
* Drop support for Ansible 2.9 and ansible-base 2.10

* Improve README

(cherry picked from commit eff87f952b)
2022-05-12 14:31:07 +02:00
Andrew Klychkov
cc78846f22
mysql_user: fix parsing privs when a user has roles assigned to it (#345) 2022-05-12 14:20:44 +02:00
patchback[bot]
65eb142960
Move CHANGELOG.rst at top level (#349) (#350)
(cherry picked from commit f57ed38beb)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2022-05-12 11:55:02 +02:00
patchback[bot]
d61d442861
mysql_user: added flush privileges to write dynamic privs into db (#338) (#339)
* added flush privileges to write dynamic privs into db
Fixes https://github.com/ansible-collections/community.mysql/issues/120

* added changelog fragment

* Update changelogs/fragments/338-mysql_user_fix_missing_dynamic_privileges.yml

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

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

Co-authored-by: bigo8525 <53953606+bigo8525@users.noreply.github.com>
2022-04-29 16:29:33 +02:00
patchback[bot]
d38813d418
mysql_role: remove redundant connection closing (fixes #329) (#330) (#332)
* mysql_role: remove redundant connection closing (fixes #329)

* add changelog fragment for pull request #330

Co-authored-by: Felix Hamme <felix.hamme@ionos.com>
(cherry picked from commit 641894e6e8)

Co-authored-by: betanummeric <40263343+betanummeric@users.noreply.github.com>
2022-04-05 11:31:38 +02:00
Andrew Klychkov
9857a16cb5
CI: add testing against ansible-core 2.13 (#327)
Co-authored-by: R.Sicart <roger.sicart@gmail.com>
2022-04-03 08:10:35 +02:00
Andrew Klychkov
2de30ed7cb
[stable-2] Backports (#324)
* 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:46 +02:00
patchback[bot]
74ab876064
mysql_user: clarify behavior of priv parameter (#319) (#321)
(cherry picked from commit 5afae459dc)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2022-03-25 14:14:44 +01:00
patchback[bot]
203338024f
Fix roles CI (#316) (#317)
(cherry picked from commit e6e661b87f)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2022-03-24 06:54:56 +01:00
patchback[bot]
82cde26b11
Setup patchback bot config file (resolves #310) (#311) (#312)
(cherry picked from commit 55458f5b0b)

Co-authored-by: R.Sicart <roger.sicart@gmail.com>
2022-03-17 09:51:14 +01:00
Andrew Klychkov
66c340e951
Add IF EXISTS clause to DROP USER statement (#307) (#308)
* Add IF EXISTS clause to DROP USER statement

* Add a changelog fragment

* Fix exception

(cherry picked from commit 3a452faeb0)
2022-03-15 15:30:23 +01:00
Andrew Klychkov
fecc9866e3
Release 2.3.5 commit (#303) 2022-03-14 15:17:21 +01:00
Andrew Klychkov
95c649cce2
Fix the collection to work with mysqlclient connector (#301) 2022-03-14 14:41:38 +01:00
Andrew Klychkov
a516c1a6ad
Update requirements (#300) 2022-03-14 12:01:18 +01:00
Andrew Klychkov
fc16243349
Fix role integration tests for mariadb (#299)
Co-authored-by: R.Sicart <roger.sicart@gmail.com>
2022-03-14 11:47:28 +01:00
Andrew Klychkov
cb960ef182
Enable and fix integration tests for devel (#297) 2022-03-14 11:13:17 +01:00
Andrew Klychkov
d7c6bddefa
Release 2.3.4 commit (#288) 2022-02-16 11:24:17 +01:00
Andrew Klychkov
8b2c418538
[stable-2] Backport from main to stable-2 (#287)
* Update CONTRIBUTORS file (#278)

(cherry picked from commit cbdf51234a)

* Honor the set_default_role_all parameter (#282)

The set_default_role_all parameter is documented, but does nothing. This PR fixes this.

(cherry picked from commit f547b66d35)

* Add a changelog fragment to PR 282 (#283)

(cherry picked from commit 952e1666d8)

Co-authored-by: Benoit Garret <benoit.garret_github@gadz.org>
2022-02-16 11:11:55 +01:00
Andrew Klychkov
9d9ea46603
Release 2.3.3 commit (#276) 2022-01-18 11:04:04 +01:00
Andrew Klychkov
9c76f1a566
[stable-2] Use vendored version of distutils.version (#269) (#273)
* 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)
2022-01-18 10:39:22 +01:00
Andrew Klychkov
a2c0bf4f0a
Release 2.3.2 commit (#253) 2021-11-29 15:52:22 +01:00
Andrew Klychkov
7aab5cc04f
Backport of PRs to stable-2 (#251)
* Allow the "%" character in database name (#227)

The naming rules for MySQL/MariaDB identifiers, when quoted, allow the
`%` character.

However, currently, the use of the `%` character in database names
results in mismatch or missing databases.

- Rewrite query to identify the databases in the catalog using
  `information_schema` instead of `SHOW DATABASES LIKE`
- Escape the `%` character in `CREATE DATABASE` query.

Signed-off-by: Nicolas Payart <npayart@gmail.com>
(cherry picked from commit 6b12435b2b)

* mysql_db: Fix assert in tests suite (#239)

Signed-off-by: Nicolas Payart <npayart@gmail.com>
(cherry picked from commit 5522e45284)

* mysql_db: Improve tests (#240)

- Define variables "db_names" and "db_formats" in defaults
- Use of the "vars" option in includes instead of default parameters
  that might be overridden by a previous task
- Use of the "loop" option in includes instead of duplicating include
  tasks
- Use a nested loop on db_names and db_formats in state_dump_import test

Signed-off-by: Nicolas Payart <npayart@gmail.com>
(cherry picked from commit e4de13aabe)

* MAINTAINERS file: Add new maintainer (#248)

(cherry picked from commit d411a8e216)

Co-authored-by: Nicolas PAYART <koleo@users.noreply.github.com>
2021-11-29 11:50:08 +01:00
Andrew Klychkov
1cb39cce0a
Release 2.3.1 commit (#236) 2021-10-19 12:41:22 +02:00
Andrew Klychkov
55a8ecd64e
[stable-2] Backport stable 2 5 (#235)
* Copy ignore-2.12.txt to ignore-2.13.txt (#225)

(cherry picked from commit 4f205ef540)

* CI matrix update (#226)

* CI matrix update

* Fix test_mysql_user

* Fix CI

* Fix CI

* Fix CI

* Fix CI

* Fix CI

(cherry picked from commit fc984b28aa)

* integration tests: remove superfluous debug task (#228)

* integration tests: remove superfluous debug task

* Turn off integration tests against devel

(cherry picked from commit f47d4635f1)

* mysql_user: fix broken compatibility for priviledge aliases (#233)

* mysql_user: fix broken compatibility for priviledge aliases

* add changelog fragment

* fix changelog fragment

* Improve formatting

(cherry picked from commit bb3e9fd3fa)
2021-10-19 12:20:30 +02:00
Andrew Klychkov
a6bacefc41
Release 2.3.0 commit (#220) 2021-09-23 13:39:01 +02:00
Andrew Klychkov
c5676ff0c9
[stable-2] Backport stable 2 4 (#219)
* Fix wrong impl for mysql (#210)

If 'mariadb' in version info, the db instance should be mariadb(reverse in code) rather than mysql.

(cherry picked from commit 663590689f)

* Update README.md (#216)

(cherry picked from commit 4de0e25ea0)

* mysql_user: replace VALID_PRIVS by get_valid_privs() function (#217)

* mysql_user: replace VALID_PRIVS by get_valid_privs() function

* Add EXTRA_PRIVS in case we need to add more privs in the future

* Add changelog fragment

(cherry picked from commit 0ce1fa1634)

Co-authored-by: int32bit <krystism@gmail.com>
Co-authored-by: R.Sicart <roger.sicart@gmail.com>
2021-09-23 12:51:32 +02:00
Andrew Klychkov
0c462c84ff
Release 2.2.0 commit (#218) 2021-09-23 11:32:06 +02:00
Andrew Klychkov
77bd3bfa2e
[stable-2] mysql_info: fix TypeError failure when there are databases that do not contain tables (#205) (#208)
* 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 (#206)

(cherry picked from commit 8a17e43eae)
2021-08-20 09:50:41 +02:00
Andrew Klychkov
2508c420ce
Update galaxy.yml after release (#202) 2021-08-11 11:12:34 +02:00
Andrew Klychkov
04c0f9f049
Release 2.2.0-a1 commit (#201) 2021-08-11 10:20:05 +02:00
Andrew Klychkov
a8e2c5290b
mysql_role: new module (#189) (#200)
* mysql_role: new module

* fixes

* fixes

* Add the role class

* Check if role exists

* role.add()

* role.__get_members

* tmp

* tmp

* Change tests

* Fix

* Fix

* add_members()

* get_privs()

* tmp

* __extract_grants() filler version

* Before big work

* tmp

* drop()

* tmp

* tmp

* Big changes

* Fix

* append_members, detach_members, append_privs

* tmp

* admin option

* Add tests

* Add tests

* Fix tests

* Remove debug warning

* Fix tests

* Add documentation

* Fix MariaDB case

* Fix MariaDB

* Fix MariaDB

* Fix MariaDB

* Fix MariaDB

* Fix MariaDB

* Fix

* Fix

* Remove debug warning

* Add try-except block

* tmp

* tmp

* tmp

* Fix

* Add err handling

* Add user check

* Check admin in db

* Fix CI

* Fix CI

* Fix CI

* Fix CI

* Fix

* Add mutually exclusive options

* Small refactoring, documenting

* Documenting, refactoring

* Change docs

* Refactoring

* Refactoring

* Refactoring

* Add unit tests

* Update README.md

(cherry picked from commit ce2b269f84)
2021-08-11 09:46:50 +02:00