community.crypto.openssl_pkcs12_info module – Return certificates and (optionally) private key of a PKCS#12 file
Note
This module is part of the community.crypto collection (version 3.5.0).
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.crypto.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: community.crypto.openssl_pkcs12_info.
New in community.crypto 3.4.0
Synopsis
This module loads an PKCS#12 file and returns the contained certificates.
If
return_private_key=true, the private key (if contained) is also returned.
Requirements
The below requirements are needed on the host that executes this module.
cryptography >= 3.3
Parameters
Parameter |
Comments |
|---|---|
The PKCS#12 password. |
|
Whether to return the private key as Avoid returning this unless needed. Choices:
|
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full This action does not modify state. |
Can run in |
|
Support: N/A This action does not modify state. |
Will return details on what has changed (or possibly needs changing in |
|
Support: full This action does not modify state. |
When run twice in a row outside check mode, with the same arguments, the second invocation indicates no change. This assumes that the system controlled/queried by the module has not changed in a relevant way. |
See Also
See also
- community.crypto.x509_certificate_info
Provide information of OpenSSL X.509 certificates.
- community.crypto.openssl_pkcs12
Generate OpenSSL PKCS#12 archive.
- community.crypto.openssl_pkcs12_extract
Extract certificate and private key from PKCS#12 archive.
Examples
---
- name: Obtain certificates from PKCS#12 file
community.crypto.openssl_pkcs12_info:
path: /opt/certs/ansible.p12
register: result
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Certificate associated to the private key in the PKCS#12 archive in PEM format. If no private key is contained in the archive, this has value Returned: success Sample: |
|
“Friendly name” of the certificate and private key pair. If no private key is contained in the archive, this has value Returned: success Sample: |
|
Other certificates (not associated to the private key) in the PKCS#12 archive in PEM format. Returned: success Sample: |
|
The PKCS#12 archive’s private key in PEM format, if present. Only returned if Returned: success if |