1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

add tests for encrypted hash mysql_user

This commit is contained in:
Jonathan Mainguy 2015-12-09 15:11:21 -05:00
parent 61dc4a7e67
commit 49dc9eea16

View file

@ -79,8 +79,23 @@
- 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