From 46785f5dd362d91ee4907dd0178e7d216b3f15f0 Mon Sep 17 00:00:00 2001 From: "E.S. Rosenberg a.k.a. Keeper of the Keys" Date: Wed, 19 Mar 2025 13:34:16 +0200 Subject: [PATCH] Add check that missing locked argument does not unlock a user Signed-off-by: E.S. Rosenberg a.k.a. Keeper of the Keys --- .../test_mysql_user/tasks/test_user_locking.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/integration/targets/test_mysql_user/tasks/test_user_locking.yml b/tests/integration/targets/test_mysql_user/tasks/test_user_locking.yml index 9897e18..9f17022 100644 --- a/tests/integration/targets/test_mysql_user/tasks/test_user_locking.yml +++ b/tests/integration/targets/test_mysql_user/tasks/test_user_locking.yml @@ -47,7 +47,17 @@ register: idempotence_check failed_when: idempotence_check is changed - - name: 'Mysql_user Lock user | create locked | Unlock test user check_mode: true' + - name: 'Mysql_user Lock user | create locked | Check that absense of locked does not unlock the user' + check_mode: true + community.mysql.mysql_user: + <<: *mysql_params + name: mysql_locked_user + 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' check_mode: true community.mysql.mysql_user: <<: *mysql_params