diff --git a/changelogs/fragments/5550-java_certs-not-enough-info-on-error.yml b/changelogs/fragments/5550-java_certs-not-enough-info-on-error.yml new file mode 100644 index 0000000000..c2b2be0418 --- /dev/null +++ b/changelogs/fragments/5550-java_certs-not-enough-info-on-error.yml @@ -0,0 +1,2 @@ +minor_changes: + - java_certs - add more detailed error output when extracting certificate from PKCS12 fails (https://github.com/ansible-collections/community.general/pull/5550). diff --git a/plugins/modules/java_cert.py b/plugins/modules/java_cert.py index 1d1327ed71..461f365a72 100644 --- a/plugins/modules/java_cert.py +++ b/plugins/modules/java_cert.py @@ -281,7 +281,8 @@ def _export_public_cert_from_pkcs12(module, executable, pkcs_file, alias, passwo (export_rc, export_stdout, export_err) = module.run_command(export_cmd, data=password, check_rc=False) if export_rc != 0: - module.fail_json(msg="Internal module failure, cannot extract public certificate from pkcs12, error: %s" % export_stdout, + module.fail_json(msg="Internal module failure, cannot extract public certificate from PKCS12, message: %s" % export_stdout, + stderr=export_err, rc=export_rc) with open(dest, 'w') as f: