diff --git a/lib/ansible/modules/cloud/amazon/route53.py b/lib/ansible/modules/cloud/amazon/route53.py index 2e5e468316a..12f096edb14 100644 --- a/lib/ansible/modules/cloud/amazon/route53.py +++ b/lib/ansible/modules/cloud/amazon/route53.py @@ -561,7 +561,14 @@ def main(): record['values'] = sorted(rset.resource_records) if command_in == 'create' and rset.to_xml() == wanted_rset.to_xml(): module.exit_json(changed=False) - break + + # We need to look only at the first rrset returned by the above call, + # so break here. The returned elements begin with the one matching our + # requested name, type, and identifier, if such an element exists, + # followed by all others that come after it in alphabetical order. + # Therefore, if the first set does not match, no subsequent set will + # match either. + break if command_in == 'get': if type_in == 'NS':