diff --git a/changelogs/fragments/1-mysql_info.yml b/changelogs/fragments/1-mysql_info.yml new file mode 100644 index 0000000..1ab4d2c --- /dev/null +++ b/changelogs/fragments/1-mysql_info.yml @@ -0,0 +1,2 @@ +minor_changes: +- mysql_info - return a database server engine used (https://github.com/ansible-collections/community.mysql/issues/644). diff --git a/plugins/modules/mysql_info.py b/plugins/modules/mysql_info.py index c119b8d..6103589 100644 --- a/plugins/modules/mysql_info.py +++ b/plugins/modules/mysql_info.py @@ -162,6 +162,12 @@ EXAMPLES = r''' ''' RETURN = r''' +server_engine: + description: Database server engine. + returned: if not excluded by filter + type: str + sample: 'MariaDB' + version_added: '3.10.0' version: description: Database server version. returned: if not excluded by filter @@ -765,6 +771,7 @@ def main(): mysql = MySQL_Info(module, cursor, server_implementation, user_implementation) module.exit_json(changed=False, + server_engine='MariaDB' if server_implementation == 'mariadb' else 'MySQL', connector_name=connector_name, connector_version=connector_version, **mysql.get_info(filter_, exclude_fields, return_empty_dbs)) diff --git a/tests/integration/targets/test_mysql_info/tasks/main.yml b/tests/integration/targets/test_mysql_info/tasks/main.yml index 5d34da9..93570f2 100644 --- a/tests/integration/targets/test_mysql_info/tasks/main.yml +++ b/tests/integration/targets/test_mysql_info/tasks/main.yml @@ -56,6 +56,7 @@ - result.databases != {} - result.engines != {} - result.users != {} + - result.server_engine == 'MariaDB' or result.server_engine == 'MySQL' - name: mysql_info - Test connector informations display ansible.builtin.import_tasks: