openssl_pkcs12 – Generate OpenSSL PKCS#12 archive¶
New in version 2.7.
Requirements¶
The below requirements are needed on the host that executes this module.
- python-pyOpenSSL
Parameters¶
See Also¶
See also
- openssl_certificate – Generate and/or check OpenSSL certificates
- The official documentation on the openssl_certificate module.
- openssl_csr – Generate OpenSSL Certificate Signing Request (CSR)
- The official documentation on the openssl_csr module.
- openssl_dhparam – Generate OpenSSL Diffie-Hellman Parameters
- The official documentation on the openssl_dhparam module.
- openssl_privatekey – Generate OpenSSL private keys
- The official documentation on the openssl_privatekey module.
- openssl_publickey – Generate an OpenSSL public key from its private key
- The official documentation on the openssl_publickey module.
Examples¶
- name: Generate PKCS#12 file
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
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
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
openssl_pkcs12:
action: parse
src: /opt/certs/ansible.p12
path: /opt/certs/ansible.pem
state: present
- name: Remove PKCS#12 file
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:
Status¶
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors¶
- Guillaume Delpierre (@gdelpierre)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.