diff --git a/lib/ansible/modules/cloud/amazon/iam_cert.py b/lib/ansible/modules/cloud/amazon/iam_cert.py index 5cb102d992..7bc5aa07dd 100644 --- a/lib/ansible/modules/cloud/amazon/iam_cert.py +++ b/lib/ansible/modules/cloud/amazon/iam_cert.py @@ -155,7 +155,7 @@ def dup_check(module, iam, name, new_name, cert, orig_cert_names, orig_cert_bodi elif slug_cert.startswith(slug_orig_cert_bodies): update = True break - elif slug_orig_cert_bodies != slug_cert: + else: module.fail_json(changed=False, msg='A cert with the name %s already exists and' ' has a different certificate body associated' ' with it. Certificates cannot have the same name' % orig_cert_names[c_index])