mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #13494 from Jmainguy/msyql_hash_tests
add tests for encrypted hash mysql_user
This commit is contained in:
commit
fc19ad21ef
1 changed files with 16 additions and 1 deletions
|
@ -79,8 +79,23 @@
|
||||||
|
|
||||||
- include: remove_user.yml user_name={{user_name_2}} user_password={{ user_password_1 }}
|
- include: remove_user.yml user_name={{user_name_2}} user_password={{ user_password_1 }}
|
||||||
|
|
||||||
|
- name: Create user with password1234 using hash. (expect changed=true)
|
||||||
|
mysql_user: name=jmainguy password='*D65798AAC0E5C6DF3F320F8A30E026E7EBD73A95' encrypted=yes
|
||||||
|
register: encrypt_result
|
||||||
|
|
||||||
|
- name: Check that the module made a change
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- "encrypt_result.changed == True"
|
||||||
|
|
||||||
|
- name: See if the password needs to be updated. (expect changed=false)
|
||||||
|
mysql_user: name=jmainguy password='password1234'
|
||||||
|
register: plain_result
|
||||||
|
|
||||||
|
- name: Check that the module did not change the password
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- "plain_result.changed == False"
|
||||||
|
|
||||||
|
- name: Remove user (cleanup)
|
||||||
|
mysql_user: name=jmainguy state=absent
|
||||||
|
|
Loading…
Reference in a new issue