ansible / ansible.builtin / v2.3.0.0-1 / module / openssl_publickey Generate an OpenSSL public key from its private key. | "added in version" 2.3 of ansible.builtin" Authors: Yanis Guenane (@Spredzy) preview | supported by communityansible.builtin.openssl_publickey (v2.3.0.0-1) — module
pip
Install with pip install ansible==2.3.0.0.post1
This module allows one to (re)generate OpenSSL public keys from their private keys. It uses the pyOpenSSL python library to interact with openssl. Keys are generated in PEM format. This module works only if the version of PyOpenSSL is recent enough (> 16.0.0)
# Generate an OpenSSL public key. - openssl_publickey: path: /etc/ssl/public/ansible.com.pem privatekey_path: /etc/ssl/private/ansible.com.pem
# Force regenerate an OpenSSL public key if it already exists - openssl_publickey: path: /etc/ssl/public/ansible.com.pem privatekey_path: /etc/ssl/private/ansible.com.pem force: True
# Remove an OpenSSL public key - openssl_publickey: path: /etc/ssl/public/ansible.com.pem privatekey_path: /etc/ssl/private/ansible.com.pem state: absent
path: description: - Name of the file in which the generated TLS/SSL public key will be written. required: true force: choices: - true - false default: false description: - Should the key be regenerated even it it already exists required: false state: choices: - present - absent default: present description: - Whether the public key should exist or not, taking action if the state is different from what is stated. required: false privatekey_path: description: - Path to the TLS/SSL private key from which to genereate the public key. required: true
filename: description: Path to the generated TLS/SSL public key file returned: - changed - success sample: /etc/ssl/public/ansible.com.pem type: string privatekey: description: Path to the TLS/SSL private key the public key was generated from returned: - changed - success sample: /etc/ssl/private/ansible.com.pem type: string