mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-10 12:40:34 -07:00
Add tests for users using SSL
This commit is contained in:
parent
36436a98a9
commit
74903feada
1 changed files with 67 additions and 2 deletions
|
@ -47,7 +47,7 @@
|
|||
state: import
|
||||
target: /root/create_procedure.sql
|
||||
|
||||
# Use a query instead of mysql_user, because we want to caches differences
|
||||
# Use a query instead of mysql_user, because we want to catch differences
|
||||
# at the end and a bug in mysql_user would be invisible to this tests
|
||||
- name: Mysql_info users_info | Prepare common tests users
|
||||
community.mysql.mysql_query:
|
||||
|
@ -147,6 +147,69 @@
|
|||
'*CB3326D5279DE7915FE5D743232165EE887883CA'
|
||||
- GRANT SELECT ON users_info_db.* TO users_info_multi_hosts@'host2'
|
||||
|
||||
- >-
|
||||
CREATE USER users_info_ssl_off@'host'
|
||||
IDENTIFIED WITH mysql_native_password AS
|
||||
'*CB3326D5279DE7915FE5D743232165EE887883CA' REQUIRE NONE
|
||||
- GRANT SELECT ON users_info_db.* TO users_info_ssl_off@'host'
|
||||
|
||||
- >-
|
||||
CREATE USER users_info_ssl@'host'
|
||||
IDENTIFIED WITH mysql_native_password AS
|
||||
'*CB3326D5279DE7915FE5D743232165EE887883CA' REQUIRE SSL
|
||||
- GRANT SELECT ON users_info_db.* TO users_info_ssl@'host'
|
||||
|
||||
- >-
|
||||
CREATE USER users_info_ssl_cipher@'host'
|
||||
IDENTIFIED WITH mysql_native_password AS
|
||||
'*CB3326D5279DE7915FE5D743232165EE887883CA'
|
||||
REQUIRE CIPHER 'ECDH-RSA-AES256-SHA384'
|
||||
- GRANT SELECT ON users_info_db.* TO users_info_ssl_cipher@'host'
|
||||
|
||||
- >-
|
||||
CREATE USER users_info_x509@'host'
|
||||
IDENTIFIED WITH mysql_native_password AS
|
||||
'*CB3326D5279DE7915FE5D743232165EE887883CA' REQUIRE X509
|
||||
- GRANT SELECT ON users_info_db.* TO users_info_x509@'host'
|
||||
|
||||
- >-
|
||||
CREATE USER users_info_ssl_subject@'host'
|
||||
IDENTIFIED WITH mysql_native_password AS
|
||||
'*CB3326D5279DE7915FE5D743232165EE887883CA'
|
||||
REQUIRE SUBJECT '/CN=Bob/O=MyDom/C=US/ST=Oregon/L=Portland'
|
||||
- GRANT SELECT ON users_info_db.* TO users_info_ssl_subject@'host'
|
||||
|
||||
- >-
|
||||
CREATE USER users_info_ssl_issuer@'host'
|
||||
IDENTIFIED WITH mysql_native_password AS
|
||||
'*CB3326D5279DE7915FE5D743232165EE887883CA'
|
||||
REQUIRE ISSUER '/C=FI/ST=Somewhere/L=City/
|
||||
O=CompanyX/CN=Bob/emailAddress=bob@companyx.com'
|
||||
- GRANT SELECT ON users_info_db.* TO users_info_ssl_issuer@'host'
|
||||
|
||||
- >-
|
||||
CREATE USER users_info_subject_ssl_issuer@'host'
|
||||
IDENTIFIED WITH mysql_native_password AS
|
||||
'*CB3326D5279DE7915FE5D743232165EE887883CA'
|
||||
REQUIRE SUBJECT '/CN=Bob/O=MyDom/C=US/ST=Oregon/L=Portland'
|
||||
AND ISSUER '/C=FI/ST=Somewhere/L=City/
|
||||
O=CompanyX/CN=Bob/emailAddress=bob@companyx.com'
|
||||
- >-
|
||||
GRANT SELECT ON users_info_db.*
|
||||
TO users_info_subject_ssl_issuer@'host'
|
||||
|
||||
- >-
|
||||
CREATE USER users_info_ssl_sub_issu_ciph@'host'
|
||||
IDENTIFIED WITH mysql_native_password AS
|
||||
'*CB3326D5279DE7915FE5D743232165EE887883CA'
|
||||
REQUIRE SUBJECT '/CN=Bob/O=MyDom/C=US/ST=Oregon/L=Portland'
|
||||
AND ISSUER '/C=FI/ST=Somewhere/L=City/
|
||||
O=CompanyX/CN=Bob/emailAddress=bob@companyx.com'
|
||||
AND CIPHER 'ECDH-RSA-AES256-SHA384'
|
||||
- >-
|
||||
GRANT SELECT ON users_info_db.*
|
||||
TO users_info_ssl_sub_issu_ciph@'host'
|
||||
|
||||
- name: Mysql_info users_info | Prepare tests users for MariaDB
|
||||
community.mysql.mysql_user:
|
||||
name: "{{ item.name }}"
|
||||
|
@ -237,7 +300,9 @@
|
|||
label: "{{ item.name }}@{{ item.host }}"
|
||||
register: recreate_users_result
|
||||
failed_when:
|
||||
- recreate_users_result is changed
|
||||
- >-
|
||||
recreate_users_result is changed or
|
||||
recreate_users_result.msg != 'User unchanged'
|
||||
when:
|
||||
- item.name != 'root'
|
||||
- item.name != 'mysql'
|
||||
|
|
Loading…
Add table
Reference in a new issue