diff --git a/changelogs/fragments/51795-acme_challenge_cert_helper-module-fail.yaml b/changelogs/fragments/51795-acme_challenge_cert_helper-module-fail.yaml new file mode 100644 index 00000000000..e09ff0f3e78 --- /dev/null +++ b/changelogs/fragments/51795-acme_challenge_cert_helper-module-fail.yaml @@ -0,0 +1,2 @@ +bugfixes: +- "acme_challenge_cert_helper - the module no longer crashes when the required ``cryptography`` library cannot be found." diff --git a/lib/ansible/modules/crypto/acme/acme_challenge_cert_helper.py b/lib/ansible/modules/crypto/acme/acme_challenge_cert_helper.py index 0f41b3514e7..cea3d87acc8 100644 --- a/lib/ansible/modules/crypto/acme/acme_challenge_cert_helper.py +++ b/lib/ansible/modules/crypto/acme/acme_challenge_cert_helper.py @@ -172,7 +172,7 @@ def main(): ), ) if not HAS_CRYPTOGRAPHY: - module.fail(msg='cryptography >= 1.3 is required for this module.') + module.fail_json(msg='cryptography >= 1.3 is required for this module.') try: # Get parameters