mysql_user: fix overriding user passowrd to the same (#609)

* mysql_user: fix overriding user passowrd to the same

* add changelog
This commit is contained in:
Andrew Klychkov 2020-07-06 15:16:48 +03:00 committed by GitHub
parent 74ba307777
commit 5e23f01a76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 13 deletions

View file

@ -46,18 +46,17 @@
register: user_password_old
when: user_password_old_create is failed
# FIXME: not sure why this is failing, but it looks like it should expect changed=true
#- name: update user2 state=present with same password (expect changed=false)
# mysql_user:
# name: '{{ user_name_2 }}'
# password: '{{ user_password_2 }}'
# priv: '*.*:ALL'
# state: present
# login_unix_socket: '{{ mysql_socket }}'
# register: result
#
#- name: assert output user2 was not updated
# assert: { that: "result.changed == false" }
- name: update user2 state=present with same password (expect changed=false)
mysql_user:
name: '{{ user_name_2 }}'
password: '{{ user_password_2 }}'
priv: '*.*:ALL'
state: present
login_unix_socket: '{{ mysql_socket }}'
register: result
- name: assert output user2 was not updated
assert: { that: "result.changed == false" }
- include: assert_user.yml user_name={{user_name_2}} priv='ALL PRIVILEGES'