Open andrewjroth opened 1 week ago
Right now the module does not care about the certificate's contents. An empty or broken file is treated as a DER certificate and converted to PEM by Base64 encoding it and adding line-breaks and header/footer.
This allows the module to also handle certificates that cryptography cannot load, for example.
Maybe we should add a verify
option or so which allows you to make sure it's a syntactically valid certificate (or more precisely: cryptography can load it).
SUMMARY
When using the module
x509_certificate_convert
, if the certificate source is bad, it will (incorrectly) report changed and the output will be empty/invalid.ISSUE TYPE
COMPONENT NAME
x509_certificate_convert
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Ubuntu 24.04
STEPS TO REPRODUCE
Run example playbook:
EXPECTED RESULTS
Playbook should fail on task "Convert certificate" because the input (
src_path
) is not a valid certificate.ACTUAL RESULTS
Playbook completes successfully, with the task "Convert certificate" showing as changed.