mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-03 20:54:25 -07:00
Test first stteps
This commit is contained in:
parent
e97324a04d
commit
a5250f2374
1 changed files with 75 additions and 104 deletions
|
@ -545,14 +545,20 @@
|
|||
register: result
|
||||
failed_when: result is success
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# ============================================================
|
||||
# Test auth plugin change
|
||||
#
|
||||
|
||||
- name: Plugin auth | Test plugin auth switching which doesn't work on pymysql < 0.9
|
||||
when:
|
||||
- >
|
||||
connector_name != 'pymysql'
|
||||
or (
|
||||
connector_name == 'pymysql'
|
||||
and connector_version is version('0.9', '>=')
|
||||
)
|
||||
block:
|
||||
|
||||
- name: Cleanup user
|
||||
ansible.builtin.include_tasks: utils/remove_user.yml
|
||||
vars:
|
||||
|
@ -573,95 +579,60 @@
|
|||
user_name: "{{ test_user_name }}"
|
||||
plugin_type: "{{ test_plugin_type }}"
|
||||
|
||||
- name: Plugin auth | Connect with user and password
|
||||
ansible.builtin.command: '{{ mysql_command }} -u {{ test_user_name }} -p{{ test_plugin_auth_string }} -e "SELECT 1"'
|
||||
# - name: Plugin auth | Connect with user and password
|
||||
# ansible.builtin.command: '{{ mysql_command }} -u {{ test_user_name }} -p{{ test_plugin_auth_string }} -e "SELECT 1"'
|
||||
|
||||
- name: Plugin auth | Change auth user plugin in check mode
|
||||
community.mysql.mysql_user:
|
||||
<<: *mysql_params
|
||||
name: "{{ test_user_name }}"
|
||||
host: '%'
|
||||
plugin: caching_sha2_password
|
||||
plugin_auth_string: "{{ test_plugin_auth_string }}"
|
||||
salt: "{{ test_salt }}"
|
||||
priv: "{{ test_default_priv }}"
|
||||
check_mode: true
|
||||
register: result
|
||||
failed_when: result is not changed
|
||||
when:
|
||||
- >
|
||||
connector_name != 'pymysql'
|
||||
or (
|
||||
connector_name == 'pymysql'
|
||||
and connector_version is version('0.9', '>=')
|
||||
)
|
||||
# - name: Plugin auth | Change auth user plugin in check mode
|
||||
# community.mysql.mysql_user:
|
||||
# <<: *mysql_params
|
||||
# name: "{{ test_user_name }}"
|
||||
# host: '%'
|
||||
# plugin: caching_sha2_password
|
||||
# plugin_auth_string: "{{ test_plugin_auth_string }}"
|
||||
# salt: "{{ test_salt }}"
|
||||
# priv: "{{ test_default_priv }}"
|
||||
# check_mode: true
|
||||
# register: result
|
||||
# failed_when: result is not changed
|
||||
|
||||
- name: Plugin auth | Check that the expected plugin type is set (not changed)
|
||||
ansible.builtin.include_tasks: utils/assert_plugin.yml
|
||||
vars:
|
||||
user_name: "{{ test_user_name }}"
|
||||
plugin_type: "{{ test_plugin_type }}"
|
||||
# - name: Plugin auth | Check that the expected plugin type is set (not changed)
|
||||
# ansible.builtin.include_tasks: utils/assert_plugin.yml
|
||||
# vars:
|
||||
# user_name: "{{ test_user_name }}"
|
||||
# plugin_type: "{{ test_plugin_type }}"
|
||||
|
||||
- name: Plugin auth | Change auth user plugin
|
||||
community.mysql.mysql_user:
|
||||
<<: *mysql_params
|
||||
name: "{{ test_user_name }}"
|
||||
host: '%'
|
||||
plugin: caching_sha2_password
|
||||
plugin_auth_string: "{{ test_plugin_auth_string }}"
|
||||
salt: "{{ test_salt }}"
|
||||
priv: "{{ test_default_priv }}"
|
||||
register: result
|
||||
failed_when: result is not changed
|
||||
when:
|
||||
- >
|
||||
connector_name != 'pymysql'
|
||||
or (
|
||||
connector_name == 'pymysql'
|
||||
and connector_version is version('0.9', '>=')
|
||||
)
|
||||
# - name: Plugin auth | Change auth user plugin
|
||||
# community.mysql.mysql_user:
|
||||
# <<: *mysql_params
|
||||
# name: "{{ test_user_name }}"
|
||||
# host: '%'
|
||||
# plugin: caching_sha2_password
|
||||
# plugin_auth_string: "{{ test_plugin_auth_string }}"
|
||||
# salt: "{{ test_salt }}"
|
||||
# priv: "{{ test_default_priv }}"
|
||||
# register: result
|
||||
# failed_when: result is not changed
|
||||
|
||||
- name: Plugin auth | Check that the expected (new) plugin type is set
|
||||
ansible.builtin.include_tasks: utils/assert_plugin.yml
|
||||
vars:
|
||||
user_name: "{{ test_user_name }}"
|
||||
plugin_type: caching_sha2_password
|
||||
when:
|
||||
- >
|
||||
connector_name != 'pymysql'
|
||||
or (
|
||||
connector_name == 'pymysql'
|
||||
and connector_version is version('0.9', '>=')
|
||||
)
|
||||
# - name: Plugin auth | Check that the expected (new) plugin type is set
|
||||
# ansible.builtin.include_tasks: utils/assert_plugin.yml
|
||||
# vars:
|
||||
# user_name: "{{ test_user_name }}"
|
||||
# plugin_type: caching_sha2_password
|
||||
|
||||
- name: Plugin auth | Change auth user plugin again (should not change)
|
||||
community.mysql.mysql_user:
|
||||
<<: *mysql_params
|
||||
name: "{{ test_user_name }}"
|
||||
host: '%'
|
||||
plugin: caching_sha2_password
|
||||
plugin_auth_string: "{{ test_plugin_auth_string }}"
|
||||
salt: "{{ test_salt }}"
|
||||
priv: "{{ test_default_priv }}"
|
||||
register: result
|
||||
failed_when: result is changed
|
||||
when:
|
||||
- >
|
||||
connector_name != 'pymysql'
|
||||
or (
|
||||
connector_name == 'pymysql'
|
||||
and connector_version is version('0.9', '>=')
|
||||
)
|
||||
# - name: Plugin auth | Change auth user plugin again (should not change)
|
||||
# community.mysql.mysql_user:
|
||||
# <<: *mysql_params
|
||||
# name: "{{ test_user_name }}"
|
||||
# host: '%'
|
||||
# plugin: caching_sha2_password
|
||||
# plugin_auth_string: "{{ test_plugin_auth_string }}"
|
||||
# salt: "{{ test_salt }}"
|
||||
# priv: "{{ test_default_priv }}"
|
||||
# register: result
|
||||
# failed_when: result is changed
|
||||
|
||||
- name: Plugin auth | Check that the expected (not changed) plugin type is set
|
||||
ansible.builtin.include_tasks: utils/assert_plugin.yml
|
||||
vars:
|
||||
user_name: "{{ test_user_name }}"
|
||||
plugin_type: caching_sha2_password
|
||||
when:
|
||||
- >
|
||||
connector_name != 'pymysql'
|
||||
or (
|
||||
connector_name == 'pymysql'
|
||||
and connector_version is version('0.9', '>=')
|
||||
)
|
||||
# - name: Plugin auth | Check that the expected (not changed) plugin type is set
|
||||
# ansible.builtin.include_tasks: utils/assert_plugin.yml
|
||||
# vars:
|
||||
# user_name: "{{ test_user_name }}"
|
||||
# plugin_type: caching_sha2_password
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue