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 0000000000..e09ff0f3e7 --- /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 d843a40855..e249f6fc2e 100644 --- a/lib/ansible/modules/crypto/acme/acme_challenge_cert_helper.py +++ b/lib/ansible/modules/crypto/acme/acme_challenge_cert_helper.py @@ -179,7 +179,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