mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-05 10:10:32 -07:00
Add idempotence checks
Signed-off-by: E.S. Rosenberg a.k.a. Keeper of the Keys <es.rosenberg+github@gmail.com>
This commit is contained in:
parent
6b8e721153
commit
3cceba40eb
1 changed files with 23 additions and 1 deletions
|
@ -36,6 +36,17 @@
|
|||
failed_when:
|
||||
- locked_user_creation.query_result[0][0] is not search('ACCOUNT LOCK')
|
||||
|
||||
- name: 'Mysql_user Lock user | create locked | Idempotence check'
|
||||
community.mysql.mysql_user:
|
||||
<<: *mysql_params
|
||||
name: mysql_locked_user
|
||||
locked: true
|
||||
check_mode: true
|
||||
priv:
|
||||
'mysql_lock_user_test.*': 'SELECT'
|
||||
register: idempotence_check
|
||||
failed_when: idempotence_check is changed
|
||||
|
||||
- name: 'Mysql_user Lock user | create locked | Unlock test user check_mode: true'
|
||||
community.mysql.mysql_user:
|
||||
<<: *mysql_params
|
||||
|
@ -95,7 +106,18 @@
|
|||
failed_when:
|
||||
- locked_user_creation.query_result[0][0] is search('ACCOUNT LOCK')
|
||||
|
||||
- name: 'Mysql_user Lock user | create unlocked | Lock test user check_mode: true'
|
||||
- name: 'Mysql_user Lock user | create unlocked | Idempotence check'
|
||||
community.mysql.mysql_user:
|
||||
<<: *mysql_params
|
||||
name: mysql_locked_user
|
||||
locked: false
|
||||
check_mode: true
|
||||
priv:
|
||||
'mysql_lock_user_test.*': 'SELECT'
|
||||
register: idempotence_check
|
||||
failed_when: idempotence_check is changed
|
||||
|
||||
- name: 'Mysql_user Lock user | create unlocked | Lock test user check_mode: true'
|
||||
community.mysql.mysql_user:
|
||||
<<: *mysql_params
|
||||
name: mysql_locked_user
|
||||
|
|
Loading…
Add table
Reference in a new issue