Merge pull request #13494 from Jmainguy/msyql_hash_tests

add tests for encrypted hash mysql_user
This commit is contained in:
Toshio Kuratomi 2015-12-14 07:58:39 -08:00
commit fc19ad21ef

View file

@ -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