Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance support of tls_requires in mysql_user and mysql_info #628

Merged

Conversation

laurent-indermuehle
Copy link
Collaborator

@laurent-indermuehle laurent-indermuehle commented Apr 12, 2024

SUMMARY

I refactored the get_tls_requires method with separate implementations for MySQL and MariaDB.
The solution for MariaDB turned out to be incompatible with MySQL.

I fixed the integration tests for mysql_info and added test users with TLS to assert that everything is working correctly.

This chang enable using the output of mysql_info: {filter: users_info} and passing it to mysql_user to achieve idempotent execution even if the user has TLS options.

I encountered an issue with MySQL 8 refusing to remove SSL and X509 when tls_requires was passed an empty value. I'm unsure why this test passed previously. Perhaps it was due to adding a sanitized method during this PR? I admit that I didn't put much effort into MySQL (even though it consumes 80% of my time...). I hope I successfully fixed that too.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

mysql_user, mysql_info

EXEMPLES

Using mysql_info with community.mysql 3.9.0:

users_info:
    - host: localhost
      name: user_ssl
      plugin: mysql_native_password
      plugin_auth_string: '*7D2ABFF56C15D67445082FBB4ACD2DCD26C0ED57'
      priv: '*.*:USAGE'

Using mysql_info with this PR:

users_info:
    - host: localhost
      name: user_ssl
      plugin: mysql_native_password
      plugin_auth_string: '*7D2ABFF56C15D67445082FBB4ACD2DCD26C0ED57'
      priv: '*.*:USAGE'
      tls_requires:  # <----------------------------------------- New
        SSL: null       # <----------------------------------------- New

@laurent-indermuehle laurent-indermuehle changed the title Lie test require ssl Enhance support of tls_requires in mysql_user and mysql_info Apr 12, 2024
@laurent-indermuehle laurent-indermuehle marked this pull request as ready for review April 12, 2024 13:24
@laurent-indermuehle
Copy link
Collaborator Author

I think I'm ready for a review. If anyone is motivated it will be appreciated! In the meantime, have a nice week-end everyone!

@Andersson007 Andersson007 merged commit 47710cf into ansible-collections:main Apr 16, 2024
43 checks passed
@Andersson007
Copy link
Collaborator

@laurent-indermuehle thanks a lot for the contribution!

@laurent-indermuehle laurent-indermuehle deleted the lie_test_require_ssl branch April 16, 2024 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants