From f41c0c7c80dc11f4e6e53bcf34d9345c588f1e99 Mon Sep 17 00:00:00 2001 From: Markus Bergholz Date: Fri, 12 Nov 2021 20:18:44 +0100 Subject: [PATCH] fix diff mode --- changelogs/fragments/802-fix-diif-mode.yml | 2 ++ plugins/modules/route53.py | 2 +- tests/integration/targets/route53/tasks/main.yml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/802-fix-diif-mode.yml diff --git a/changelogs/fragments/802-fix-diif-mode.yml b/changelogs/fragments/802-fix-diif-mode.yml new file mode 100644 index 00000000000..4be35cb0812 --- /dev/null +++ b/changelogs/fragments/802-fix-diif-mode.yml @@ -0,0 +1,2 @@ +bugfixes: +- route53 - fix diff mode when deleting records (https://github.com/ansible-collections/community.aws/pull/801). \ No newline at end of file diff --git a/plugins/modules/route53.py b/plugins/modules/route53.py index 964020257db..81aee6223d5 100644 --- a/plugins/modules/route53.py +++ b/plugins/modules/route53.py @@ -692,7 +692,7 @@ def main(): changed=True, diff=dict( before=formatted_aws, - after=formatted_record if command != 'delete' else {}, + after=formatted_record if command_in != 'delete' else {}, resource_record_sets=rr_sets, ), ) diff --git a/tests/integration/targets/route53/tasks/main.yml b/tests/integration/targets/route53/tasks/main.yml index c5312437f0b..92caadc2b9b 100644 --- a/tests/integration/targets/route53/tasks/main.yml +++ b/tests/integration/targets/route53/tasks/main.yml @@ -386,6 +386,7 @@ that: - wc_a_record is not failed - wc_a_record is changed + - wc_a_record.diff.after == {} # Tests on zone two (private zone) - name: Create A record using zone fqdn