mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-07 06:34:25 -07:00
Refactor test_mysql_user to work with other host than localhost
This commit is contained in:
parent
978676a6dc
commit
9da866a7bf
27 changed files with 675 additions and 758 deletions
|
@ -3,47 +3,50 @@
|
|||
mysql_parameters: &mysql_params
|
||||
login_user: '{{ mysql_user }}'
|
||||
login_password: '{{ mysql_password }}'
|
||||
login_host: '{{ gateway_addr }}'
|
||||
login_host: '{{ mysql_host }}'
|
||||
login_port: '{{ mysql_primary_port }}'
|
||||
|
||||
block:
|
||||
|
||||
- name: Set root password
|
||||
- name: Issue-64560 | Set root password
|
||||
mysql_user:
|
||||
<<: *mysql_params
|
||||
name: root
|
||||
host: '%'
|
||||
password: '{{ root_password }}'
|
||||
check_implicit_admin: yes
|
||||
register: result
|
||||
|
||||
- name: assert root password is changed
|
||||
- name: Issue-64560 | Assert root password is changed
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
|
||||
- name: Set root password again
|
||||
- name: Issue-64560 | Set root password again
|
||||
mysql_user:
|
||||
login_user: '{{ mysql_user }}'
|
||||
login_password: '{{ root_password }}'
|
||||
login_host: '{{ gateway_addr }}'
|
||||
login_host: '{{ mysql_host }}'
|
||||
login_port: '{{ mysql_primary_port }}'
|
||||
name: root
|
||||
host: '%'
|
||||
password: '{{ root_password }}'
|
||||
check_implicit_admin: yes
|
||||
register: result
|
||||
|
||||
- name: Assert root password is not changed
|
||||
- name: Issue-64560 | Assert root password is not changed
|
||||
assert:
|
||||
that:
|
||||
- result is not changed
|
||||
|
||||
- name: Set root password again
|
||||
- name: Issue-64560 | Set root password again
|
||||
mysql_user:
|
||||
login_user: '{{ mysql_user }}'
|
||||
login_password: '{{ root_password }}'
|
||||
login_host: '{{ gateway_addr }}'
|
||||
login_host: '{{ mysql_host }}'
|
||||
login_port: '{{ mysql_primary_port }}'
|
||||
name: root
|
||||
host: '%'
|
||||
password: '{{ mysql_password }}'
|
||||
check_implicit_admin: yes
|
||||
register: result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue