<linkrel="prev"title="community.crypto.openssl_csr_info module – Provide information of OpenSSL Certificate Signing Requests (CSR)"href="openssl_csr_info_module.html"/><!-- extra head elements for Ansible beyond RTD Sphinx Theme -->
</head>
<bodyclass="wy-body-for-nav"><!-- extra body elements for Ansible beyond RTD Sphinx Theme -->
<liclass="toctree-l1"><aclass="reference internal"href="docsite/guide_selfsigned.html">How to create self-signed certificates</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="docsite/guide_ownca.html">How to create a small CA</a></li>
</ul>
<ulclass="current">
<liclass="toctree-l1"><aclass="reference internal"href="acme_account_module.html">community.crypto.acme_account module – Create, modify or delete ACME accounts</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="acme_account_info_module.html">community.crypto.acme_account_info module – Retrieves information on ACME accounts</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="acme_ari_info_module.html">community.crypto.acme_ari_info module – Retrieves ACME Renewal Information (ARI) for a certificate</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="acme_certificate_module.html">community.crypto.acme_certificate module – Create SSL/TLS certificates with the ACME protocol</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="acme_certificate_deactivate_authz_module.html">community.crypto.acme_certificate_deactivate_authz module – Deactivate all authz for an ACME v2 order</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="acme_certificate_renewal_info_module.html">community.crypto.acme_certificate_renewal_info module – Determine whether a certificate should be renewed or not</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="acme_certificate_revoke_module.html">community.crypto.acme_certificate_revoke module – Revoke certificates with the ACME protocol</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="acme_challenge_cert_helper_module.html">community.crypto.acme_challenge_cert_helper module – Prepare certificates required for ACME challenges such as <codeclass="docutils literal notranslate"><spanclass="pre">tls-alpn-01</span></code></a></li>
<liclass="toctree-l1"><aclass="reference internal"href="acme_inspect_module.html">community.crypto.acme_inspect module – Send direct requests to an ACME server</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="certificate_complete_chain_module.html">community.crypto.certificate_complete_chain module – Complete certificate chain given a set of untrusted and root certificates</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="ecs_certificate_module.html">community.crypto.ecs_certificate module – Request SSL/TLS certificates with the Entrust Certificate Services (ECS) API</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="ecs_domain_module.html">community.crypto.ecs_domain module – Request validation of a domain with the Entrust Certificate Services (ECS) API</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="get_certificate_module.html">community.crypto.get_certificate module – Get a certificate from a host:port</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="openssh_cert_module.html">community.crypto.openssh_cert module – Generate OpenSSH host or user certificates</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="openssh_keypair_module.html">community.crypto.openssh_keypair module – Generate OpenSSH private and public keys</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="openssl_csr_info_module.html">community.crypto.openssl_csr_info module – Provide information of OpenSSL Certificate Signing Requests (CSR)</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="openssl_privatekey_info_module.html">community.crypto.openssl_privatekey_info module – Provide information for OpenSSL private keys</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="openssl_privatekey_pipe_module.html">community.crypto.openssl_privatekey_pipe module – Generate OpenSSL private keys without disk access</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="openssl_publickey_module.html">community.crypto.openssl_publickey module – Generate an OpenSSL public key from its private key</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="openssl_publickey_info_module.html">community.crypto.openssl_publickey_info module – Provide information for OpenSSL public keys</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="openssl_signature_module.html">community.crypto.openssl_signature module – Sign data with openssl</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="openssl_signature_info_module.html">community.crypto.openssl_signature_info module – Verify signatures with openssl</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="x509_certificate_info_module.html">community.crypto.x509_certificate_info module – Provide information of OpenSSL X.509 certificates</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="x509_crl_info_module.html">community.crypto.x509_crl_info module – Retrieve information on Certificate Revocation Lists (CRLs)</a></li>
</ul>
<ul>
<liclass="toctree-l1"><aclass="reference internal"href="gpg_fingerprint_filter.html">community.crypto.gpg_fingerprint filter – Retrieve a GPG fingerprint from a GPG public or private key</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="openssl_csr_info_filter.html">community.crypto.openssl_csr_info filter – Retrieve information from OpenSSL Certificate Signing Requests (CSR)</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="openssl_privatekey_info_filter.html">community.crypto.openssl_privatekey_info filter – Retrieve information from OpenSSL private keys</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="openssl_publickey_info_filter.html">community.crypto.openssl_publickey_info filter – Retrieve information from OpenSSL public keys in PEM format</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="parse_serial_filter.html">community.crypto.parse_serial filter – Convert a serial number as a colon-separated list of hex numbers to an integer</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="to_serial_filter.html">community.crypto.to_serial filter – Convert an integer to a colon-separated list of hex numbers</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="x509_certificate_info_filter.html">community.crypto.x509_certificate_info filter – Retrieve information from X.509 certificates in PEM format</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="x509_crl_info_filter.html">community.crypto.x509_crl_info filter – Retrieve information from X.509 CRLs in PEM format</a></li>
</ul>
<ul>
<liclass="toctree-l1"><aclass="reference internal"href="gpg_fingerprint_lookup.html">community.crypto.gpg_fingerprint lookup – Retrieve a GPG fingerprint from a GPG public or private key file</a></li>
</ul>
<!-- extra nav elements for Ansible beyond RTD Sphinx Theme -->
<ahref="https://github.com/ansible-collections/community.crypto/edit/main/plugins/modules/openssl_csr_pipe.py?description=%23%23%23%23%23%20SUMMARY%0A%3C!—%20Your%20description%20here%20–%3E%0A%0A%0A%23%23%23%23%23%20ISSUE%20TYPE%0A-%20Docs%20Pull%20Request%0A%0A%2Blabel:%20docsite_pr"class="fa fa-github"> Edit on GitHub</a>
<h1>community.crypto.openssl_csr_pipe module – Generate OpenSSL Certificate Signing Request (CSR)<aclass="headerlink"href="#community-crypto-openssl-csr-pipe-module-generate-openssl-certificate-signing-request-csr"title="Link to this heading"></a></h1>
<divclass="admonition note">
<pclass="admonition-title">Note</p>
<p>This module is part of the <aclass="reference external"href="https://galaxy.ansible.com/ui/repo/published/community/crypto/">community.crypto collection</a> (version 2.23.0).</p>
<p>It is not included in <codeclass="docutils literal notranslate"><spanclass="pre">ansible-core</span></code>.
To check whether it is installed, run <codeclass="code docutils literal notranslate"><spanclass="pre">ansible-galaxy</span><spanclass="pre">collection</span><spanclass="pre">list</span></code>.</p>
You need further requirements to be able to use this module,
see <aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-requirements"><spanclass="std std-ref">Requirements</span></a> for details.</p>
<p>To use it in a playbook, specify: <codeclass="code docutils literal notranslate"><spanclass="pre">community.crypto.openssl_csr_pipe</span></code>.</p>
</div>
<pclass="ansible-version-added">New in community.crypto 1.3.0</p>
<h2><aclass="toc-backref"href="#id1"role="doc-backlink">Synopsis</a><aclass="headerlink"href="#synopsis"title="Link to this heading"></a></h2>
<ulclass="simple">
<li><p>Please note that the module regenerates an existing CSR if it does not match the module’s options, or if it seems to be corrupt.</p></li>
<li><p>This module allows one to (re)generate OpenSSL certificate signing requests.</p></li>
<li><p>This module supports the subjectAltName, keyUsage, extendedKeyUsage, basicConstraints and OCSP Must Staple extensions.</p></li>
</ul>
</section>
<sectionid="requirements">
<spanid="ansible-collections-community-crypto-openssl-csr-pipe-module-requirements"></span><h2><aclass="toc-backref"href="#id2"role="doc-backlink">Requirements</a><aclass="headerlink"href="#requirements"title="Link to this heading"></a></h2>
<p>The below requirements are needed on the host that executes this module.</p>
<ulclass="simple">
<li><p>cryptography >= 1.3</p></li>
</ul>
</section>
<sectionid="parameters">
<h2><aclass="toc-backref"href="#id3"role="doc-backlink">Parameters</a><aclass="headerlink"href="#parameters"title="Link to this heading"></a></h2>
<aclass="ansibleOptionLink"href="#parameter-authority_cert_issuer"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Names that will be present in the authority cert issuer field of the certificate signing request.</p>
<p>Values must be prefixed by their options. (That is, <codeclass="docutils literal notranslate"><spanclass="pre">email</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">URI</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">DNS</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">RID</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">IP</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">dirName</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">otherName</span></code>, and the ones specific to your CA).</p>
<p>If specified, <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-authority-cert-serial-number"><spanclass="std std-ref"><spanclass="pre">authority_cert_serial_number</span></span></a></strong></code> must also be specified.</p>
<p>Please note that commercial CAs ignore this value, respectively use a value of their own choice. Specifying this option is mostly useful for self-signed certificates or for own CAs.</p>
<p>Note that this is only supported if the <codeclass="docutils literal notranslate"><spanclass="pre">cryptography</span></code> backend is used!</p>
<p>The <codeclass="docutils literal notranslate"><spanclass="pre">AuthorityKeyIdentifier</span></code> extension will only be added if at least one of <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-authority-key-identifier"><spanclass="std std-ref"><spanclass="pre">authority_key_identifier</span></span></a></strong></code>, <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-authority-cert-issuer"><spanclass="std std-ref"><spanclass="pre">authority_cert_issuer</span></span></a></strong></code> and <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-authority-cert-serial-number"><spanclass="std std-ref"><spanclass="pre">authority_cert_serial_number</span></span></a></strong></code> is specified.</p>
<aclass="ansibleOptionLink"href="#parameter-authority_cert_serial_number"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">integer</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>The authority cert serial number.</p>
<p>If specified, <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-authority-cert-issuer"><spanclass="std std-ref"><spanclass="pre">authority_cert_issuer</span></span></a></strong></code> must also be specified.</p>
<p>Note that this is only supported if the <codeclass="docutils literal notranslate"><spanclass="pre">cryptography</span></code> backend is used!</p>
<p>Please note that commercial CAs ignore this value, respectively use a value of their own choice. Specifying this option is mostly useful for self-signed certificates or for own CAs.</p>
<p>The <codeclass="docutils literal notranslate"><spanclass="pre">AuthorityKeyIdentifier</span></code> extension will only be added if at least one of <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-authority-key-identifier"><spanclass="std std-ref"><spanclass="pre">authority_key_identifier</span></span></a></strong></code>, <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-authority-cert-issuer"><spanclass="std std-ref"><spanclass="pre">authority_cert_issuer</span></span></a></strong></code> and <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-authority-cert-serial-number"><spanclass="std std-ref"><spanclass="pre">authority_cert_serial_number</span></span></a></strong></code> is specified.</p>
<p>This option accepts an <strong>integer</strong>. If you want to provide serial numbers as colon-separated hex strings, such as <codeclass="docutils literal notranslate"><spanclass="pre">11:22:33</span></code>, you need to convert them to an integer with <aclass="reference internal"href="parse_serial_filter.html#ansible-collections-community-crypto-parse-serial-filter"><spanclass="std std-ref">community.crypto.parse_serial</span></a>.</p>
<aclass="ansibleOptionLink"href="#parameter-authority_key_identifier"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>The authority key identifier as a hex string, where two bytes are separated by colons.</p>
<p>Please note that commercial CAs ignore this value, respectively use a value of their own choice. Specifying this option is mostly useful for self-signed certificates or for own CAs.</p>
<p>Note that this is only supported if the <codeclass="docutils literal notranslate"><spanclass="pre">cryptography</span></code> backend is used!</p>
<p>The <codeclass="docutils literal notranslate"><spanclass="pre">AuthorityKeyIdentifier</span></code> extension will only be added if at least one of <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-authority-key-identifier"><spanclass="std std-ref"><spanclass="pre">authority_key_identifier</span></span></a></strong></code>, <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-authority-cert-issuer"><spanclass="std std-ref"><spanclass="pre">authority_cert_issuer</span></span></a></strong></code> and <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-authority-cert-serial-number"><spanclass="std std-ref"><spanclass="pre">authority_cert_serial_number</span></span></a></strong></code> is specified.</p>
<aclass="ansibleOptionLink"href="#parameter-basic_constraints"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-aliases">aliases: basicConstraints</span></p>
<aclass="ansibleOptionLink"href="#parameter-basic_constraints_critical"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-aliases">aliases: basicConstraints_critical</span></p>
<aclass="ansibleOptionLink"href="#parameter-common_name"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-aliases">aliases: CN, commonName</span></p>
<aclass="ansibleOptionLink"href="#parameter-content"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
<aclass="ansibleOptionLink"href="#parameter-country_name"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-aliases">aliases: C, countryName</span></p>
<aclass="ansibleOptionLink"href="#parameter-create_subject_key_identifier"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">boolean</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Create the Subject Key Identifier from the public key.</p>
<p>Please note that commercial CAs can ignore the value, respectively use a value of their own choice instead. Specifying this option is mostly useful for self-signed certificates or for own CAs.</p>
<p>Note that this is only supported if the <codeclass="docutils literal notranslate"><spanclass="pre">cryptography</span></code> backend is used!</p>
<aclass="ansibleOptionLink"href="#parameter-crl_distribution_points"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=dictionary</span></p>
<p><emclass="ansible-option-versionadded">added in community.crypto 1.4.0</em></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Allows to specify one or multiple CRL distribution points.</p>
<p>Only supported by the <codeclass="docutils literal notranslate"><spanclass="pre">cryptography</span></code> backend.</p>
<aclass="ansibleOptionLink"href="#parameter-crl_distribution_points/crl_issuer"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=string</span></p>
</div></td>
<td><divclass="ansible-option-indent-desc"></div><divclass="ansible-option-cell"><p>Information about the issuer of the CRL.</p>
<aclass="ansibleOptionLink"href="#parameter-crl_distribution_points/full_name"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=string</span></p>
</div></td>
<td><divclass="ansible-option-indent-desc"></div><divclass="ansible-option-cell"><p>Describes how the CRL can be retrieved.</p>
<p>Mutually exclusive with <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-crl-distribution-points-relative-name"><spanclass="std std-ref"><spanclass="pre">crl_distribution_points[].relative_name</span></span></a></strong></code>.</p>
<aclass="ansibleOptionLink"href="#parameter-crl_distribution_points/reasons"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=string</span></p>
</div></td>
<td><divclass="ansible-option-indent-desc"></div><divclass="ansible-option-cell"><p>List of reasons that this distribution point can be used for when performing revocation checks.</p>
<aclass="ansibleOptionLink"href="#parameter-crl_distribution_points/relative_name"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=string</span></p>
</div></td>
<td><divclass="ansible-option-indent-desc"></div><divclass="ansible-option-cell"><p>Describes how the CRL can be retrieved relative to the CRL issuer.</p>
<p>Mutually exclusive with <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-crl-distribution-points-full-name"><spanclass="std std-ref"><spanclass="pre">crl_distribution_points[].full_name</span></span></a></strong></code>.</p>
<aclass="ansibleOptionLink"href="#parameter-digest"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>The digest used when signing the certificate signing request with the private key.</p>
<aclass="ansibleOptionLink"href="#parameter-email_address"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-aliases">aliases: E, emailAddress</span></p>
<aclass="ansibleOptionLink"href="#parameter-extended_key_usage"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-aliases">aliases: extKeyUsage, extendedKeyUsage</span></p>
<td><divclass="ansible-option-cell"><p>Additional restrictions (for example client authentication, server authentication) on the allowed purposes for which the public key may be used.</p>
<aclass="ansibleOptionLink"href="#parameter-extended_key_usage_critical"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-aliases">aliases: extKeyUsage_critical, extendedKeyUsage_critical</span></p>
<aclass="ansibleOptionLink"href="#parameter-key_usage"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-aliases">aliases: keyUsage</span></p>
<td><divclass="ansible-option-cell"><p>This defines the purpose (for example encipherment, signature, certificate signing) of the key contained in the certificate.</p>
<aclass="ansibleOptionLink"href="#parameter-key_usage_critical"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-aliases">aliases: keyUsage_critical</span></p>
<aclass="ansibleOptionLink"href="#parameter-locality_name"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-aliases">aliases: L, localityName</span></p>
<aclass="ansibleOptionLink"href="#parameter-name_constraints_critical"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">boolean</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Should the Name Constraints extension be considered as critical.</p>
<aclass="ansibleOptionLink"href="#parameter-name_constraints_excluded"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>For CA certificates, this specifies a list of identifiers which describe subtrees of names that this CA is <strong>not</strong> allowed to issue certificates for.</p>
<p>Values must be prefixed by their options. (That is, <codeclass="docutils literal notranslate"><spanclass="pre">email</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">URI</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">DNS</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">RID</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">IP</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">dirName</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">otherName</span></code>, and the ones specific to your CA).</p>
<aclass="ansibleOptionLink"href="#parameter-name_constraints_permitted"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>For CA certificates, this specifies a list of identifiers which describe subtrees of names that this CA is allowed to issue certificates for.</p>
<p>Values must be prefixed by their options. (That is, <codeclass="docutils literal notranslate"><spanclass="pre">email</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">URI</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">DNS</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">RID</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">IP</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">dirName</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">otherName</span></code>, and the ones specific to your CA).</p>
<aclass="ansibleOptionLink"href="#parameter-ocsp_must_staple"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-aliases">aliases: ocspMustStaple</span></p>
<td><divclass="ansible-option-cell"><p>Indicates that the certificate should contain the OCSP Must Staple extension (<aclass="reference external"href="https://tools.ietf.org/html/rfc7633">https://tools.ietf.org/html/rfc7633</a>).</p>
<aclass="ansibleOptionLink"href="#parameter-ocsp_must_staple_critical"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-aliases">aliases: ocspMustStaple_critical</span></p>
<td><divclass="ansible-option-cell"><p>Should the OCSP Must Staple extension be considered as critical.</p>
<p>Note that according to the RFC, this extension should not be marked as critical, as old clients not knowing about OCSP Must Staple are required to reject such certificates (see <aclass="reference external"href="https://tools.ietf.org/html/rfc7633#section-4">https://tools.ietf.org/html/rfc7633#section-4</a>).</p>
<aclass="ansibleOptionLink"href="#parameter-organization_name"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-aliases">aliases: O, organizationName</span></p>
<aclass="ansibleOptionLink"href="#parameter-organizational_unit_name"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-aliases">aliases: OU, organizationalUnitName</span></p>
<aclass="ansibleOptionLink"href="#parameter-privatekey_content"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>The content of the private key to use when signing the certificate signing request.</p>
<p>Either <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-privatekey-path"><spanclass="std std-ref"><spanclass="pre">privatekey_path</span></span></a></strong></code> or <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-privatekey-content"><spanclass="std std-ref"><spanclass="pre">privatekey_content</span></span></a></strong></code> must be specified, but not both.</p>
<aclass="ansibleOptionLink"href="#parameter-privatekey_passphrase"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>The passphrase for the private key.</p>
<p>This is required if the private key is password protected.</p>
<aclass="ansibleOptionLink"href="#parameter-privatekey_path"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">path</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>The path to the private key to use when signing the certificate signing request.</p>
<p>Either <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-privatekey-path"><spanclass="std std-ref"><spanclass="pre">privatekey_path</span></span></a></strong></code> or <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-privatekey-content"><spanclass="std std-ref"><spanclass="pre">privatekey_content</span></span></a></strong></code> must be specified, but not both.</p>
<aclass="ansibleOptionLink"href="#parameter-select_crypto_backend"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Determines which crypto backend to use.</p>
<p>The default choice is <codeclass="ansible-value docutils literal notranslate"><spanclass="pre">auto</span></code>, which tries to use <codeclass="docutils literal notranslate"><spanclass="pre">cryptography</span></code> if available.</p>
<p>If set to <codeclass="ansible-value docutils literal notranslate"><spanclass="pre">cryptography</span></code>, will try to use the <aclass="reference external"href="https://cryptography.io/">cryptography</a> library.</p>
<aclass="ansibleOptionLink"href="#parameter-state_or_province_name"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-aliases">aliases: ST, stateOrProvinceName</span></p>
<aclass="ansibleOptionLink"href="#parameter-subject"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">dictionary</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Key/value pairs that will be present in the subject name field of the certificate signing request.</p>
<p>If you need to specify more than one value with the same key, use a list as value.</p>
<p>If the order of the components is important, use <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-subject-ordered"><spanclass="std std-ref"><spanclass="pre">subject_ordered</span></span></a></strong></code>.</p>
<p>Mutually exclusive with <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-subject-ordered"><spanclass="std std-ref"><spanclass="pre">subject_ordered</span></span></a></strong></code>.</p>
<aclass="ansibleOptionLink"href="#parameter-subject_alt_name"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-aliases">aliases: subjectAltName</span></p>
<td><divclass="ansible-option-cell"><p>Subject Alternative Name (SAN) extension to attach to the certificate signing request.</p>
<p>Values must be prefixed by their options. (These are <codeclass="docutils literal notranslate"><spanclass="pre">email</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">URI</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">DNS</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">RID</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">IP</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">dirName</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">otherName</span></code>, and the ones specific to your CA).</p>
<p>Note that if no SAN is specified, but a common name, the common name will be added as a SAN except if <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-use-common-name-for-san"><spanclass="std std-ref"><spanclass="pre">use_common_name_for_san</span></span></a></strong></code> is set to <codeclass="ansible-value docutils literal notranslate"><spanclass="pre">false</span></code>.</p>
<p>More at <aclass="reference external"href="https://tools.ietf.org/html/rfc5280#section-4.2.1.6">https://tools.ietf.org/html/rfc5280#section-4.2.1.6</a>.</p>
<aclass="ansibleOptionLink"href="#parameter-subject_alt_name_critical"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-aliases">aliases: subjectAltName_critical</span></p>
<aclass="ansibleOptionLink"href="#parameter-subject_key_identifier"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>The subject key identifier as a hex string, where two bytes are separated by colons.</p>
<p>Please note that commercial CAs ignore this value, respectively use a value of their own choice. Specifying this option is mostly useful for self-signed certificates or for own CAs.</p>
<p>Note that this option can only be used if <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-create-subject-key-identifier"><spanclass="std std-ref"><spanclass="pre">create_subject_key_identifier</span></span></a></strong></code> is <codeclass="ansible-value docutils literal notranslate"><spanclass="pre">false</span></code>.</p>
<p>Note that this is only supported if the <codeclass="docutils literal notranslate"><spanclass="pre">cryptography</span></code> backend is used!</p>
<aclass="ansibleOptionLink"href="#parameter-subject_ordered"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=dictionary</span></p>
<p><emclass="ansible-option-versionadded">added in community.crypto 2.0.0</em></p>
</div></td>
<td><divclass="ansible-option-cell"><p>A list of dictionaries, where every dictionary must contain one key/value pair. This key/value pair will be present in the subject name field of the certificate signing request.</p>
<p>If you want to specify more than one value with the same key in a row, you can use a list as value.</p>
<p>Mutually exclusive with <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-subject"><spanclass="std std-ref"><spanclass="pre">subject</span></span></a></strong></code>, and any other subject field option, such as <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-country-name"><spanclass="std std-ref"><spanclass="pre">country_name</span></span></a></strong></code>, <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-state-or-province-name"><spanclass="std std-ref"><spanclass="pre">state_or_province_name</span></span></a></strong></code>, <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-locality-name"><spanclass="std std-ref"><spanclass="pre">locality_name</span></span></a></strong></code>, <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-organization-name"><spanclass="std std-ref"><spanclass="pre">organization_name</span></span></a></strong></code>, <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-organizational-unit-name"><spanclass="std std-ref"><spanclass="pre">organizational_unit_name</span></span></a></strong></code>, <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-common-name"><spanclass="std std-ref"><spanclass="pre">common_name</span></span></a></strong></code>, or <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-email-address"><spanclass="std std-ref"><spanclass="pre">email_address</span></span></a></strong></code>.</p>
<aclass="ansibleOptionLink"href="#parameter-use_common_name_for_san"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-aliases">aliases: useCommonNameForSAN</span></p>
<td><divclass="ansible-option-cell"><p>If set to <codeclass="ansible-value docutils literal notranslate"><spanclass="pre">true</span></code>, the module will fill the common name in for <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-subject-alt-name"><spanclass="std std-ref"><spanclass="pre">subject_alt_name</span></span></a></strong></code> with <codeclass="docutils literal notranslate"><spanclass="pre">DNS:</span></code> prefix if no SAN is specified.</p>
<aclass="ansibleOptionLink"href="#parameter-version"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">integer</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>The version of the certificate signing request.</p>
<p>The only allowed value according to <aclass="reference external"href="https://tools.ietf.org/html/rfc2986#section-4.1">RFC 2986</a> is 1.</p>
<p>This option no longer accepts unsupported values since community.crypto 2.0.0.</p>
<p>Currently in check mode, private keys will not be (re-)generated, only the changed status is set. This will change in community.crypto 3.0.0.</p>
<p>From community.crypto 3.0.0 on, the module will ignore check mode and always behave as if check mode is not active. If you think this breaks your use-case of this module, please create an issue in the community.crypto repository.</p>
</div></td>
<td><divclass="ansible-option-cell"><p>Can run in <codeclass="docutils literal notranslate"><spanclass="pre">check_mode</span></code> and return changed status prediction without modifying target.</p>
<td><divclass="ansible-option-cell"><p>Will return details on what has changed (or possibly needs changing in <codeclass="docutils literal notranslate"><spanclass="pre">check_mode</span></code>), when in diff mode.</p>
<td><divclass="ansible-option-cell"><p>When run twice in a row outside check mode, with the same arguments, the second invocation indicates no change.</p>
<p>This assumes that the system controlled/queried by the module has not changed in a relevant way.</p>
</div></td>
</tr>
</tbody>
</table>
</section>
<sectionid="notes">
<h2><aclass="toc-backref"href="#id5"role="doc-backlink">Notes</a><aclass="headerlink"href="#notes"title="Link to this heading"></a></h2>
<divclass="admonition note">
<pclass="admonition-title">Note</p>
<ulclass="simple">
<li><p>If the certificate signing request already exists it will be checked whether subjectAltName, keyUsage, extendedKeyUsage and basicConstraints only contain the requested values, whether OCSP Must Staple is as requested, and if the request was signed by the given private key.</p></li>
</ul>
</div>
</section>
<sectionid="see-also">
<h2><aclass="toc-backref"href="#id6"role="doc-backlink">See Also</a><aclass="headerlink"href="#see-also"title="Link to this heading"></a></h2>
<dt><aclass="reference internal"href="openssl_privatekey_pipe_module.html#ansible-collections-community-crypto-openssl-privatekey-pipe-module"><spanclass="std std-ref">community.crypto.openssl_privatekey_pipe</span></a></dt><dd><p>Generate OpenSSL private keys without disk access.</p>
</dd>
<dt><aclass="reference internal"href="openssl_publickey_module.html#ansible-collections-community-crypto-openssl-publickey-module"><spanclass="std std-ref">community.crypto.openssl_publickey</span></a></dt><dd><p>Generate an OpenSSL public key from its private key.</p>
</dd>
<dt><aclass="reference internal"href="openssl_csr_info_module.html#ansible-collections-community-crypto-openssl-csr-info-module"><spanclass="std std-ref">community.crypto.openssl_csr_info</span></a></dt><dd><p>Provide information of OpenSSL Certificate Signing Requests (CSR).</p>
</dd>
<dt><aclass="reference internal"href="parse_serial_filter.html#ansible-collections-community-crypto-parse-serial-filter"><spanclass="std std-ref">community.crypto.parse_serial</span></a> filter plugin</dt><dd><p>Convert a serial number as a colon-separated list of hex numbers to an integer.</p>
</dd>
</dl>
</div>
</section>
<sectionid="examples">
<h2><aclass="toc-backref"href="#id7"role="doc-backlink">Examples</a><aclass="headerlink"href="#examples"title="Link to this heading"></a></h2>
<divclass="highlight-yaml+jinja notranslate"><divclass="highlight"><pre><span></span><spanclass="p p-Indicator">-</span><spanclass="w"></span><spanclass="nt">name</span><spanclass="p">:</span><spanclass="w"></span><spanclass="l l-Scalar l-Scalar-Plain">Generate an OpenSSL Certificate Signing Request</span>
<spanclass="p p-Indicator">-</span><spanclass="w"></span><spanclass="nt">name</span><spanclass="p">:</span><spanclass="w"></span><spanclass="l l-Scalar l-Scalar-Plain">Generate an OpenSSL Certificate Signing Request with an inline CSR</span>
<spanclass="w"></span><spanclass="nt">when</span><spanclass="p">:</span><spanclass="w"></span><spanclass="l l-Scalar l-Scalar-Plain">result is changed</span>
</pre></div>
</div>
</section>
<sectionid="return-values">
<h2><aclass="toc-backref"href="#id8"role="doc-backlink">Return Values</a><aclass="headerlink"href="#return-values"title="Link to this heading"></a></h2>
<p>Common return values are documented <aclass="reference external"href="https://docs.ansible.com/ansible/devel/reference_appendices/common_return_values.html#common-return-values"title="(in Ansible vdevel)"><spanclass="xref std std-ref">here</span></a>, the following are the fields unique to this module:</p>
<aclass="ansibleOptionLink"href="#return-basicConstraints"title="Permalink to this return value"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Indicates if the certificate belongs to a CA.</p>
<pclass="ansible-option-line"><strongclass="ansible-option-returned-bold">Returned:</strong> changed or success</p>
<aclass="ansibleOptionLink"href="#return-csr"title="Permalink to this return value"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>The (current or generated) CSR’s content.</p>
<pclass="ansible-option-line"><strongclass="ansible-option-returned-bold">Returned:</strong> changed or success</p>
<aclass="ansibleOptionLink"href="#return-extendedKeyUsage"title="Permalink to this return value"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Additional restriction on the public key purposes.</p>
<pclass="ansible-option-line"><strongclass="ansible-option-returned-bold">Returned:</strong> changed or success</p>
<aclass="ansibleOptionLink"href="#return-keyUsage"title="Permalink to this return value"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Purpose for which the public key may be used.</p>
<pclass="ansible-option-line"><strongclass="ansible-option-returned-bold">Returned:</strong> changed or success</p>
<aclass="ansibleOptionLink"href="#return-name_constraints_excluded"title="Permalink to this return value"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>List of excluded subtrees the CA cannot sign certificates for.</p>
<pclass="ansible-option-line"><strongclass="ansible-option-returned-bold">Returned:</strong> changed or success</p>
<aclass="ansibleOptionLink"href="#return-name_constraints_permitted"title="Permalink to this return value"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>List of permitted subtrees to sign certificates for.</p>
<pclass="ansible-option-line"><strongclass="ansible-option-returned-bold">Returned:</strong> changed or success</p>
<aclass="ansibleOptionLink"href="#return-ocsp_must_staple"title="Permalink to this return value"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">boolean</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Indicates whether the certificate has the OCSP Must Staple feature enabled.</p>
<pclass="ansible-option-line"><strongclass="ansible-option-returned-bold">Returned:</strong> changed or success</p>
<aclass="ansibleOptionLink"href="#return-privatekey"title="Permalink to this return value"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Path to the TLS/SSL private key the CSR was generated for.</p>
<p>Will be <codeclass="ansible-value docutils literal notranslate"><spanclass="pre">none</span></code> if the private key has been provided in <codeclass="ansible-option docutils literal notranslate"><strong><aclass="reference internal"href="#ansible-collections-community-crypto-openssl-csr-pipe-module-parameter-privatekey-content"><spanclass="std std-ref"><spanclass="pre">privatekey_content</span></span></a></strong></code>.</p>
<pclass="ansible-option-line"><strongclass="ansible-option-returned-bold">Returned:</strong> changed or success</p>
<aclass="ansibleOptionLink"href="#return-subject"title="Permalink to this return value"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=list</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>A list of the subject tuples attached to the CSR.</p>
<pclass="ansible-option-line"><strongclass="ansible-option-returned-bold">Returned:</strong> changed or success</p>
<aclass="ansibleOptionLink"href="#return-subjectAltName"title="Permalink to this return value"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>The alternative names this CSR is valid for.</p>
<pclass="ansible-option-line"><strongclass="ansible-option-returned-bold">Returned:</strong> changed or success</p>
<li><span><aaria-role="button"class="ansible-link reference external"href="https://forum.ansible.com/tags/c/help/6/none/crypto"rel="noopener external"target="_blank">Ask for help (crypto)</a></span></li>
<li><span><aaria-role="button"class="ansible-link reference external"href="https://forum.ansible.com/tags/c/help/6/none/acme"rel="noopener external"target="_blank">Ask for help (ACME)</a></span></li>
<li><span><aaria-role="button"class="ansible-link reference external"href="https://github.com/ansible-collections/community.crypto/issues/new?assignees=&labels=&template=bug_report.md"rel="noopener external"target="_blank">Submit a bug report</a></span></li>
<li><span><aaria-role="button"class="ansible-link reference external"href="https://github.com/ansible-collections/community.crypto/issues/new?assignees=&labels=&template=feature_request.md"rel="noopener external"target="_blank">Request a feature</a></span></li>
<ahref="openssl_csr_info_module.html"class="btn btn-neutral float-left"title="community.crypto.openssl_csr_info module – Provide information of OpenSSL Certificate Signing Requests (CSR)"accesskey="p"rel="prev"><spanclass="fa fa-arrow-circle-left"aria-hidden="true"></span> Previous</a>