add unit test for mysql_user (#17335)
this removes all blank users, and then does so again to ensure changed the first time and ok the second time
This commit is contained in:
parent
3a83379b1d
commit
2248d2464b
1 changed files with 18 additions and 0 deletions
|
@ -23,3 +23,21 @@
|
|||
|
||||
- name: assert output message mysql user was removed
|
||||
assert: { that: "result.changed == true" }
|
||||
|
||||
# ============================================================
|
||||
- name: create blank mysql user to be removed later
|
||||
mysql_user: name="" state=present
|
||||
|
||||
- name: remove blank mysql user with hosts=all (expect changed)
|
||||
mysql_user: user="" host_all=true state=absent
|
||||
register: result
|
||||
|
||||
- name: assert changed is true for removing all blank users
|
||||
assert: { that: "result.changed == true" }
|
||||
|
||||
- name: remove blank mysql user with hosts=all (expect ok)
|
||||
mysql_user: user="" host_all=true state=absent
|
||||
register: result
|
||||
|
||||
- name: assert changed is true for removing all blank users
|
||||
assert: { that: "result.changed == false" }
|
||||
|
|
Loading…
Reference in a new issue