community.crypto.openssl_pkcs12 – Generate OpenSSL PKCS#12 archive¶
Note
This plugin is part of the community.crypto collection (version 1.3.0).
To install it use: ansible-galaxy collection install community.crypto
.
To use it in a playbook, specify: community.crypto.openssl_pkcs12
.
Requirements¶
The below requirements are needed on the host that executes this module.
python-pyOpenSSL
Parameters¶
See Also¶
See also
- community.crypto.x509_certificate
The official documentation on the community.crypto.x509_certificate module.
- community.crypto.openssl_csr
The official documentation on the community.crypto.openssl_csr module.
- community.crypto.openssl_dhparam
The official documentation on the community.crypto.openssl_dhparam module.
- community.crypto.openssl_privatekey
The official documentation on the community.crypto.openssl_privatekey module.
- community.crypto.openssl_publickey
The official documentation on the community.crypto.openssl_publickey module.
Examples¶
- name: Generate PKCS#12 file
community.crypto.openssl_pkcs12:
action: export
path: /opt/certs/ansible.p12
friendly_name: raclette
privatekey_path: /opt/certs/keys/key.pem
certificate_path: /opt/certs/cert.pem
other_certificates: /opt/certs/ca.pem
state: present
- name: Change PKCS#12 file permission
community.crypto.openssl_pkcs12:
action: export
path: /opt/certs/ansible.p12
friendly_name: raclette
privatekey_path: /opt/certs/keys/key.pem
certificate_path: /opt/certs/cert.pem
other_certificates: /opt/certs/ca.pem
state: present
mode: '0600'
- name: Regen PKCS#12 file
community.crypto.openssl_pkcs12:
action: export
src: /opt/certs/ansible.p12
path: /opt/certs/ansible.p12
friendly_name: raclette
privatekey_path: /opt/certs/keys/key.pem
certificate_path: /opt/certs/cert.pem
other_certificates: /opt/certs/ca.pem
state: present
mode: '0600'
force: yes
- name: Dump/Parse PKCS#12 file
community.crypto.openssl_pkcs12:
action: parse
src: /opt/certs/ansible.p12
path: /opt/certs/ansible.pem
state: present
- name: Remove PKCS#12 file
community.crypto.openssl_pkcs12:
path: /opt/certs/ansible.p12
state: absent
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
backup_file
string
|
changed and if backup is yes |
Name of backup file created.
Sample:
/path/to/[email protected]:22~
|
filename
string
|
changed or success |
Path to the generate PKCS#12 file.
Sample:
/opt/certs/ansible.p12
|
pkcs12
string
added in 1.0.0 of community.crypto |
if state is present and return_content is yes |
The (current or generated) PKCS#12's content Base64 encoded.
|
privatekey
string
|
changed or success |
Path to the TLS/SSL private key the public key was generated from.
Sample:
/etc/ssl/private/ansible.com.pem
|
Authors¶
Guillaume Delpierre (@gdelpierre)