mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-02 20:24:24 -07:00
tests: fix syntax
This commit is contained in:
parent
3edba3d8ca
commit
12a2bd358e
13 changed files with 201 additions and 54 deletions
|
@ -31,7 +31,10 @@
|
||||||
that:
|
that:
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- include_tasks: utils/assert_user.yml user_name={{ user_name_1 }} user_host=localhost
|
- include_tasks: utils/assert_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_1 }}"
|
||||||
|
user_host: localhost
|
||||||
|
|
||||||
# Test user removal
|
# Test user removal
|
||||||
- name: Issue-265 | remove mysql user {{ user_name_1 }}
|
- name: Issue-265 | remove mysql user {{ user_name_1 }}
|
||||||
|
@ -86,7 +89,9 @@
|
||||||
that:
|
that:
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- include_tasks: utils/assert_no_user.yml user_name={{user_name_1}}
|
- include_tasks: utils/assert_no_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{user_name_1}}"
|
||||||
|
|
||||||
# Tests with force_context: no
|
# Tests with force_context: no
|
||||||
# Test user creation
|
# Test user creation
|
||||||
|
@ -114,7 +119,10 @@
|
||||||
that:
|
that:
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- include_tasks: utils/assert_user.yml user_name={{ user_name_1 }} user_host=localhost
|
- include_tasks: utils/assert_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_1 }}"
|
||||||
|
user_host: localhost
|
||||||
|
|
||||||
# Test user removal
|
# Test user removal
|
||||||
- name: Issue-265 | Remove mysql user {{ user_name_1 }}
|
- name: Issue-265 | Remove mysql user {{ user_name_1 }}
|
||||||
|
@ -168,4 +176,6 @@
|
||||||
that:
|
that:
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- include_tasks: utils/assert_no_user.yml user_name={{ user_name_1 }}
|
- include_tasks: utils/assert_no_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_1 }}"
|
||||||
|
|
|
@ -79,4 +79,6 @@
|
||||||
- foo
|
- foo
|
||||||
- bar
|
- bar
|
||||||
|
|
||||||
- include_tasks: utils/remove_user.yml user_name="{{ user_name_2 }}"
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_2 }}"
|
||||||
|
|
|
@ -54,11 +54,20 @@
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- include_tasks: utils/assert_user.yml user_name={{ user_name_1 }} user_host=localhost priv=USAGE
|
- include_tasks: utils/assert_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_1 }}"
|
||||||
|
user_host: localhost
|
||||||
|
priv: USAGE
|
||||||
|
|
||||||
- include_tasks: utils/remove_user.yml user_name={{ user_name_1 }}
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_1 }}"
|
||||||
|
|
||||||
|
- include_tasks: utils/assert_no_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_1 }}"
|
||||||
|
|
||||||
- include_tasks: utils/assert_no_user.yml user_name={{ user_name_1 }}
|
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# Create user with select privileges and verify select privileges are assign
|
# Create user with select privileges and verify select privileges are assign
|
||||||
|
@ -72,11 +81,20 @@
|
||||||
priv: '*.*:SELECT'
|
priv: '*.*:SELECT'
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- include_tasks: utils/assert_user.yml user_name={{ user_name_2 }} user_host=localhost priv=SELECT
|
- include_tasks: utils/assert_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_2 }}"
|
||||||
|
user_host: localhost
|
||||||
|
priv: SELECT
|
||||||
|
|
||||||
- include_tasks: utils/remove_user.yml user_name={{ user_name_2 }}
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_2 }}"
|
||||||
|
|
||||||
|
- include_tasks: utils/assert_no_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_2 }}"
|
||||||
|
|
||||||
- include_tasks: utils/assert_no_user.yml user_name={{ user_name_2 }}
|
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# Assert user has access to multiple databases
|
# Assert user has access to multiple databases
|
||||||
|
@ -112,9 +130,13 @@
|
||||||
- "'{{ item }}' in result.stdout"
|
- "'{{ item }}' in result.stdout"
|
||||||
with_items: "{{db_names}}"
|
with_items: "{{db_names}}"
|
||||||
|
|
||||||
- include_tasks: utils/remove_user.yml user_name={{ user_name_1 }}
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_1 }}"
|
||||||
|
|
||||||
- include_tasks: utils/remove_user.yml user_name={{ user_name_2 }}
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_2 }}"
|
||||||
|
|
||||||
- name: Give user SELECT access to database via wildcard
|
- name: Give user SELECT access to database via wildcard
|
||||||
mysql_user:
|
mysql_user:
|
||||||
|
@ -172,7 +194,9 @@
|
||||||
- "'%db' in result.stdout"
|
- "'%db' in result.stdout"
|
||||||
- "'INSERT' in result.stdout"
|
- "'INSERT' in result.stdout"
|
||||||
|
|
||||||
- include_tasks: utils/remove_user.yml user_name={{user_name_1}}
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{user_name_1}}"
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# Test plaintext and encrypted password scenarios.
|
# Test plaintext and encrypted password scenarios.
|
||||||
|
|
|
@ -10,7 +10,10 @@
|
||||||
# ========================================================================
|
# ========================================================================
|
||||||
# Creation
|
# Creation
|
||||||
# ========================================================================
|
# ========================================================================
|
||||||
- include_tasks: utils/create_user.yml user_name={{ user_name_1 }} user_password={{ user_password_1 }}
|
- include_tasks: utils/create_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_1 }}"
|
||||||
|
user_password: "{{ user_password_1 }}"
|
||||||
|
|
||||||
- name: Idempotency | Create user that already exist (expect changed=false)
|
- name: Idempotency | Create user that already exist (expect changed=false)
|
||||||
mysql_user:
|
mysql_user:
|
||||||
|
|
|
@ -131,4 +131,6 @@
|
||||||
- data1
|
- data1
|
||||||
- data2
|
- data2
|
||||||
|
|
||||||
- include_tasks: utils/remove_user.yml user_name={{ user_name_4 }}
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_4 }}"
|
||||||
|
|
|
@ -151,4 +151,6 @@
|
||||||
- data2
|
- data2
|
||||||
- data3
|
- data3
|
||||||
|
|
||||||
- include_tasks: utils/remove_user.yml user_name="{{ user_name_3 }}"
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_3 }}"
|
||||||
|
|
|
@ -172,4 +172,6 @@
|
||||||
loop:
|
loop:
|
||||||
- data1
|
- data1
|
||||||
|
|
||||||
- include_tasks: utils/remove_user.yml user_name="{{ user_name_4 }}"
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_4 }}"
|
||||||
|
|
|
@ -37,7 +37,11 @@
|
||||||
state: present
|
state: present
|
||||||
when: current_append_privs == "yes"
|
when: current_append_privs == "yes"
|
||||||
|
|
||||||
- include_tasks: utils/assert_user.yml user_name={{ user_name_2 }} user_host=% priv='SELECT'
|
- include_tasks: utils/assert_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_2 }}"
|
||||||
|
user_host: "%"
|
||||||
|
priv: 'SELECT'
|
||||||
when: current_append_privs == "yes"
|
when: current_append_privs == "yes"
|
||||||
|
|
||||||
- name: Privs | Create user with current privileges (expect changed=true)
|
- name: Privs | Create user with current privileges (expect changed=true)
|
||||||
|
@ -188,7 +192,9 @@
|
||||||
that:
|
that:
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- include_tasks: utils/remove_user.yml user_name="{{ user_name_2 }}"
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_2 }}"
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
- name: Privs | Grant all privileges with grant option
|
- name: Privs | Grant all privileges with grant option
|
||||||
|
@ -259,4 +265,6 @@
|
||||||
- result is failed
|
- result is failed
|
||||||
- "'Error granting privileges' in result.msg"
|
- "'Error granting privileges' in result.msg"
|
||||||
|
|
||||||
- include_tasks: utils/remove_user.yml user_name="{{ user_name_2 }}"
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_2 }}"
|
||||||
|
|
|
@ -6,7 +6,9 @@
|
||||||
login_host: '{{ mysql_host }}'
|
login_host: '{{ mysql_host }}'
|
||||||
login_port: '{{ mysql_primary_port }}'
|
login_port: '{{ mysql_primary_port }}'
|
||||||
block:
|
block:
|
||||||
- include_tasks: utils/remove_user.yml user_name={{ user_name_1 }}
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_1 }}"
|
||||||
|
|
||||||
- name: Revoke only grants | Create user with two grants
|
- name: Revoke only grants | Create user with two grants
|
||||||
mysql_user:
|
mysql_user:
|
||||||
|
@ -47,4 +49,6 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
always:
|
always:
|
||||||
- include_tasks: utils/remove_user.yml user_name={{ user_name_1 }}
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_1 }}"
|
||||||
|
|
|
@ -23,7 +23,9 @@
|
||||||
that:
|
that:
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- include_tasks: utils/assert_no_user.yml user_name={{user_name_1}}
|
- include_tasks: utils/assert_no_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{user_name_1}}"
|
||||||
|
|
||||||
- name: Tls reqs | Create user with TLS requirements state=present (expect changed=true)
|
- name: Tls reqs | Create user with TLS requirements state=present (expect changed=true)
|
||||||
mysql_user:
|
mysql_user:
|
||||||
|
@ -172,14 +174,26 @@
|
||||||
assert:
|
assert:
|
||||||
that: "'REQUIRE ' not in result.stdout or 'REQUIRE NONE' in result.stdout"
|
that: "'REQUIRE ' not in result.stdout or 'REQUIRE NONE' in result.stdout"
|
||||||
|
|
||||||
- include_tasks: utils/remove_user.yml user_name={{user_name_1}}
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{user_name_1}}"
|
||||||
|
|
||||||
- include_tasks: utils/remove_user.yml user_name={{user_name_2}}
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{user_name_2}}"
|
||||||
|
|
||||||
- include_tasks: utils/remove_user.yml user_name={{user_name_3}}
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{user_name_3}}"
|
||||||
|
|
||||||
- include_tasks: utils/assert_no_user.yml user_name={{user_name_1}}
|
- include_tasks: utils/assert_no_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{user_name_1}}"
|
||||||
|
|
||||||
- include_tasks: utils/assert_no_user.yml user_name={{user_name_2}}
|
- include_tasks: utils/assert_no_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{user_name_2}}"
|
||||||
|
|
||||||
- include_tasks: utils/assert_no_user.yml user_name={{user_name_3}}
|
- include_tasks: utils/assert_no_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{user_name_3}}"
|
||||||
|
|
|
@ -81,7 +81,9 @@
|
||||||
- data1
|
- data1
|
||||||
- data2
|
- data2
|
||||||
|
|
||||||
- include_tasks: utils/remove_user.yml user_name={{ user_name_3 }}
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ user_name_3 }}"
|
||||||
|
|
||||||
- name: User grants with roles applied | Drop test role
|
- name: User grants with roles applied | Drop test role
|
||||||
mysql_role:
|
mysql_role:
|
||||||
|
|
|
@ -36,7 +36,11 @@
|
||||||
that:
|
that:
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- include_tasks: utils/assert_user.yml user_name={{ test_user_name }} user_host=% priv={{ test_default_priv_type }}
|
- include_tasks: utils/assert_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
user_host: "%"
|
||||||
|
priv: "{{ test_default_priv_type }}"
|
||||||
|
|
||||||
- name: Password | Get the MySQL version using the newly created used creds
|
- name: Password | Get the MySQL version using the newly created used creds
|
||||||
mysql_info:
|
mysql_info:
|
||||||
|
@ -68,7 +72,11 @@
|
||||||
that:
|
that:
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- include_tasks: utils/assert_user.yml user_name={{ test_user_name }} user_host=% priv={{ test_default_priv_type }}
|
- include_tasks: utils/assert_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
user_host: "%"
|
||||||
|
priv: "{{ test_default_priv_type }}"
|
||||||
|
|
||||||
- name: Password | Update the user password
|
- name: Password | Update the user password
|
||||||
mysql_user:
|
mysql_user:
|
||||||
|
@ -84,7 +92,11 @@
|
||||||
that:
|
that:
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- include_tasks: utils/assert_user.yml user_name={{ test_user_name }} user_host=% priv={{ test_default_priv_type }}
|
- include_tasks: utils/assert_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
user_host: "%"
|
||||||
|
priv: "{{ test_default_priv_type }}"
|
||||||
|
|
||||||
- name: Password | Get the MySQL version data using the original password (should fail)
|
- name: Password | Get the MySQL version data using the original password (should fail)
|
||||||
mysql_info:
|
mysql_info:
|
||||||
|
@ -117,7 +129,9 @@
|
||||||
- result is succeeded
|
- result is succeeded
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
- include_tasks: utils/remove_user.yml user_name={{ test_user_name }}
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# Test setting a plaintext password and then the same password encrypted to ensure there isn't a change detected.
|
# Test setting a plaintext password and then the same password encrypted to ensure there isn't a change detected.
|
||||||
|
@ -137,7 +151,11 @@
|
||||||
that:
|
that:
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- include_tasks: utils/assert_user.yml user_name={{ test_user_name }} user_host=localhost priv={{ test_default_priv_type }}
|
- include_tasks: utils/assert_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
user_host: "localhost"
|
||||||
|
priv: "{{ test_default_priv_type }}"
|
||||||
|
|
||||||
- name: Password | Pass in the same password as before, but in the encrypted form (no change expected)
|
- name: Password | Pass in the same password as before, but in the encrypted form (no change expected)
|
||||||
mysql_user:
|
mysql_user:
|
||||||
|
@ -155,7 +173,9 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
- include_tasks: utils/remove_user.yml user_name={{ test_user_name }}
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# Test setting an encrypted password and then the same password in plaintext to ensure there isn't a change.
|
# Test setting an encrypted password and then the same password in plaintext to ensure there isn't a change.
|
||||||
|
@ -177,7 +197,11 @@
|
||||||
that:
|
that:
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- include_tasks: utils/assert_user.yml user_name={{ test_user_name }} user_host=% priv={{ test_default_priv_type }}
|
- include_tasks: utils/assert_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
user_host: "%"
|
||||||
|
priv: "{{ test_default_priv_type }}"
|
||||||
|
|
||||||
- name: Password | Get the MySQL version data using the new creds
|
- name: Password | Get the MySQL version data using the new creds
|
||||||
mysql_info:
|
mysql_info:
|
||||||
|
@ -209,7 +233,9 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
- include_tasks: utils/remove_user.yml user_name={{ test_user_name }}
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# Test setting an empty password.
|
# Test setting an empty password.
|
||||||
|
@ -274,4 +300,6 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
- include_tasks: utils/remove_user.yml user_name={{ test_user_name }}
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
|
|
@ -47,7 +47,11 @@
|
||||||
- "'{{ test_plugin_type }}' in show_create_user.stdout"
|
- "'{{ test_plugin_type }}' in show_create_user.stdout"
|
||||||
when: db_engine == 'mysql' or (db_engine == 'mariadb' and db_version is version('10.3', '>='))
|
when: db_engine == 'mysql' or (db_engine == 'mariadb' and db_version is version('10.3', '>='))
|
||||||
|
|
||||||
- include_tasks: utils/assert_user.yml user_name={{ test_user_name }} user_host=% priv={{ test_default_priv_type }}
|
- include_tasks: utils/assert_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
user_host: "%"
|
||||||
|
priv: "{{ test_default_priv_type }}"
|
||||||
|
|
||||||
- name: Plugin auth | Get the MySQL version using the newly created creds
|
- name: Plugin auth | Get the MySQL version using the newly created creds
|
||||||
mysql_info:
|
mysql_info:
|
||||||
|
@ -77,7 +81,11 @@
|
||||||
that:
|
that:
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- include_tasks: utils/assert_user.yml user_name={{ test_user_name }} user_host=% priv={{ test_default_priv_type }}
|
- include_tasks: utils/assert_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
user_host: "%"
|
||||||
|
priv: "{{ test_default_priv_type }}"
|
||||||
|
|
||||||
- name: Plugin auth | Getting the MySQL info with the new password should work
|
- name: Plugin auth | Getting the MySQL info with the new password should work
|
||||||
mysql_info:
|
mysql_info:
|
||||||
|
@ -94,7 +102,9 @@
|
||||||
- result is succeeded
|
- result is succeeded
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
- include_tasks: utils/remove_user.yml user_name={{ test_user_name }}
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# Test plugin auth initially setting a hash and then switching to a plaintext auth string.
|
# Test plugin auth initially setting a hash and then switching to a plaintext auth string.
|
||||||
|
@ -125,7 +135,11 @@
|
||||||
- "'{{ test_plugin_type }}' in show_create_user.stdout"
|
- "'{{ test_plugin_type }}' in show_create_user.stdout"
|
||||||
when: db_engine == 'mysql' or (db_engine == 'mariadb' and db_version is version('10.3', '>='))
|
when: db_engine == 'mysql' or (db_engine == 'mariadb' and db_version is version('10.3', '>='))
|
||||||
|
|
||||||
- include_tasks: utils/assert_user.yml user_name={{ test_user_name }} user_host=% priv={{ test_default_priv_type }}
|
- include_tasks: utils/assert_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
user_host: "%"
|
||||||
|
priv: "{{ test_default_priv_type }}"
|
||||||
|
|
||||||
- name: Plugin auth | Get the MySQL version using the newly created creds
|
- name: Plugin auth | Get the MySQL version using the newly created creds
|
||||||
mysql_info:
|
mysql_info:
|
||||||
|
@ -157,7 +171,11 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
when: db_engine == 'mysql' or (db_engine == 'mariadb' and db_version is version('10.3', '>='))
|
when: db_engine == 'mysql' or (db_engine == 'mariadb' and db_version is version('10.3', '>='))
|
||||||
|
|
||||||
- include_tasks: utils/assert_user.yml user_name={{ test_user_name }} user_host=% priv={{ test_default_priv_type }}
|
- include_tasks: utils/assert_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
user_host: "%"
|
||||||
|
priv: "{{ test_default_priv_type }}"
|
||||||
|
|
||||||
- name: Plugin auth | Change the user using the same plugin, but switch to the same auth string in plaintext form
|
- name: Plugin auth | Change the user using the same plugin, but switch to the same auth string in plaintext form
|
||||||
mysql_user:
|
mysql_user:
|
||||||
|
@ -189,7 +207,9 @@
|
||||||
- result is succeeded
|
- result is succeeded
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
- include_tasks: utils/remove_user.yml user_name={{ test_user_name }}
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# Test plugin auth initially setting a plaintext auth string and then switching to a hash.
|
# Test plugin auth initially setting a plaintext auth string and then switching to a hash.
|
||||||
|
@ -220,7 +240,11 @@
|
||||||
- test_plugin_type in show_create_user.stdout
|
- test_plugin_type in show_create_user.stdout
|
||||||
when: db_engine == 'mysql' or (db_engine == 'mariadb' and db_version is version('10.3', '>='))
|
when: db_engine == 'mysql' or (db_engine == 'mariadb' and db_version is version('10.3', '>='))
|
||||||
|
|
||||||
- include_tasks: utils/assert_user.yml user_name={{ test_user_name }} user_host=% priv={{ test_default_priv_type }}
|
- include_tasks: utils/assert_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
user_host: "%"
|
||||||
|
priv: "{{ test_default_priv_type }}"
|
||||||
|
|
||||||
- name: Plugin auth | Get the MySQL version using the newly created creds
|
- name: Plugin auth | Get the MySQL version using the newly created creds
|
||||||
mysql_info:
|
mysql_info:
|
||||||
|
@ -252,7 +276,11 @@
|
||||||
that:
|
that:
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- include_tasks: utils/assert_user.yml user_name={{ test_user_name }} user_host=% priv={{ test_default_priv_type }}
|
- include_tasks: utils/assert_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
user_host: "%"
|
||||||
|
priv: "{{ test_default_priv_type }}"
|
||||||
|
|
||||||
- name: Plugin auth | Change the user using the same plugin, but switch to the same auth string in hash form
|
- name: Plugin auth | Change the user using the same plugin, but switch to the same auth string in hash form
|
||||||
mysql_user:
|
mysql_user:
|
||||||
|
@ -283,7 +311,9 @@
|
||||||
- result is succeeded
|
- result is succeeded
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
- include_tasks: utils/remove_user.yml user_name={{ test_user_name }}
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# Test plugin auth with an empty auth string.
|
# Test plugin auth with an empty auth string.
|
||||||
|
@ -313,7 +343,11 @@
|
||||||
- "'{{ test_plugin_type }}' in show_create_user.stdout"
|
- "'{{ test_plugin_type }}' in show_create_user.stdout"
|
||||||
when: db_engine == 'mysql' or (db_engine == 'mariadb' and db_version is version('10.3', '>='))
|
when: db_engine == 'mysql' or (db_engine == 'mariadb' and db_version is version('10.3', '>='))
|
||||||
|
|
||||||
- include_tasks: utils/assert_user.yml user_name={{ test_user_name }} user_host=% priv={{ test_default_priv_type }}
|
- include_tasks: utils/assert_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
user_host: "%"
|
||||||
|
priv: "{{ test_default_priv_type }}"
|
||||||
|
|
||||||
- name: Plugin auth | Get the MySQL version using an empty password for the newly created user
|
- name: Plugin auth | Get the MySQL version using an empty password for the newly created user
|
||||||
mysql_info:
|
mysql_info:
|
||||||
|
@ -360,7 +394,9 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
- include_tasks: utils/remove_user.yml user_name={{ test_user_name }}
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# Test plugin auth switching from one type of plugin to another without an auth string or hash. The only other
|
# Test plugin auth switching from one type of plugin to another without an auth string or hash. The only other
|
||||||
|
@ -400,7 +436,11 @@
|
||||||
- test_plugin_type in show_create_user.stdout
|
- test_plugin_type in show_create_user.stdout
|
||||||
when: db_engine == 'mysql' or (db_engine == 'mariadb' and db_version is version('10.3', '>='))
|
when: db_engine == 'mysql' or (db_engine == 'mariadb' and db_version is version('10.3', '>='))
|
||||||
|
|
||||||
- include_tasks: utils/assert_user.yml user_name={{ test_user_name }} user_host=localhost priv={{ test_default_priv_type }}
|
- include_tasks: utils/assert_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
user_host: localhost
|
||||||
|
priv: "{{ test_default_priv_type }}"
|
||||||
|
|
||||||
- name: Plugin auth | Switch user to sha256_password auth plugin
|
- name: Plugin auth | Switch user to sha256_password auth plugin
|
||||||
mysql_user:
|
mysql_user:
|
||||||
|
@ -425,7 +465,13 @@
|
||||||
- "'sha256_password' in show_create_user.stdout"
|
- "'sha256_password' in show_create_user.stdout"
|
||||||
when: db_engine == 'mysql' or (db_engine == 'mariadb' and db_version is version('10.3', '>='))
|
when: db_engine == 'mysql' or (db_engine == 'mariadb' and db_version is version('10.3', '>='))
|
||||||
|
|
||||||
- include_tasks: utils/assert_user.yml user_name={{ test_user_name }} user_host=localhost priv={{ test_default_priv_type }}
|
- include_tasks: utils/assert_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
user_host: localhost
|
||||||
|
priv: "{{ test_default_priv_type }}"
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
- include_tasks: utils/remove_user.yml user_name={{ test_user_name }}
|
- include_tasks: utils/remove_user.yml
|
||||||
|
vars:
|
||||||
|
user_name: "{{ test_user_name }}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue