From 0c68410d16a94fd9e0e056402ff8734677af598d Mon Sep 17 00:00:00 2001 From: Steve Teahan <75569952+steveteahan@users.noreply.github.com> Date: Mon, 14 Dec 2020 20:34:06 -0500 Subject: [PATCH] Added fragments and check_mode tests --- changelogs/fragments/72-mysql_user_change_detection.yml | 2 ++ tests/integration/targets/test_mysql_user/tasks/main.yml | 3 ++- .../test_mysql_user/tasks/test_priv_append_no_change.yml | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/72-mysql_user_change_detection.yml diff --git a/changelogs/fragments/72-mysql_user_change_detection.yml b/changelogs/fragments/72-mysql_user_change_detection.yml new file mode 100644 index 0000000..21c6141 --- /dev/null +++ b/changelogs/fragments/72-mysql_user_change_detection.yml @@ -0,0 +1,2 @@ +bugfixes: +- mysql_user - fixed change detection when using append_privs (https://github.com/ansible-collections/community.mysql/pull/72). diff --git a/tests/integration/targets/test_mysql_user/tasks/main.yml b/tests/integration/targets/test_mysql_user/tasks/main.yml index 1e201a0..52ea0c7 100644 --- a/tests/integration/targets/test_mysql_user/tasks/main.yml +++ b/tests/integration/targets/test_mysql_user/tasks/main.yml @@ -263,7 +263,8 @@ # Test that append_privs will not attempt to make a change where current privileges are a superset of new privileges # (https://github.com/ansible-collections/community.mysql/issues/69) - - include: test_priv_append_no_change.yml + - include: test_priv_append_no_change.yml enable_check_mode=no + - include: test_priv_append_no_change.yml enable_check_mode=yes # Tests for the TLS requires dictionary - include: tls_requirements.yml diff --git a/tests/integration/targets/test_mysql_user/tasks/test_priv_append_no_change.yml b/tests/integration/targets/test_mysql_user/tasks/test_priv_append_no_change.yml index 3ef1c30..c952970 100644 --- a/tests/integration/targets/test_mysql_user/tasks/test_priv_append_no_change.yml +++ b/tests/integration/targets/test_mysql_user/tasks/test_priv_append_no_change.yml @@ -44,6 +44,7 @@ priv: 'data1.*:SELECT/data2.*:SELECT' append_privs: yes state: present + check_mode: '{{ enable_check_mode }}' register: result - name: Assert that there wasn't a change and that the permissions are still the same