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:
E.S. Rosenberg a.k.a. Keeper of the Keys 2025-03-06 16:14:34 +02:00
parent 6b8e721153
commit 3cceba40eb

View file

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