From cde6c1554c83773efca588e5df342577fedb6903 Mon Sep 17 00:00:00 2001 From: felixfontein Date: Sun, 12 Jan 2025 16:12:32 +0000 Subject: [PATCH] deploy: 49354f2121e8b294d73907e8da3796c9d868682d --- branch/main/acme_account_facts_module.html | 4 + branch/main/acme_account_info_module.html | 4 + branch/main/acme_account_module.html | 4 + branch/main/acme_ari_info_module.html | 4 + ...e_certificate_deactivate_authz_module.html | 8 +- branch/main/acme_certificate_module.html | 4 + .../acme_certificate_order_create_module.html | 820 +++++++++++++++++ ...cme_certificate_order_finalize_module.html | 808 ++++++++++++++++ .../acme_certificate_order_info_module.html | 865 ++++++++++++++++++ ...cme_certificate_order_validate_module.html | 694 ++++++++++++++ .../acme_certificate_renewal_info_module.html | 8 +- .../main/acme_certificate_revoke_module.html | 4 + .../acme_challenge_cert_helper_module.html | 4 + branch/main/acme_inspect_module.html | 4 + .../certificate_complete_chain_module.html | 4 + branch/main/changelog.html | 4 + branch/main/crypto_info_module.html | 4 + branch/main/docsite/guide_ownca.html | 4 + branch/main/docsite/guide_selfsigned.html | 4 + branch/main/ecs_certificate_module.html | 4 + branch/main/ecs_domain_module.html | 4 + branch/main/environment_variables.html | 4 + branch/main/get_certificate_module.html | 4 + branch/main/gpg_fingerprint_filter.html | 4 + branch/main/gpg_fingerprint_lookup.html | 4 + branch/main/index.html | 8 + branch/main/luks_device_module.html | 4 + branch/main/objects.inv | Bin 17431 -> 19268 bytes branch/main/openssh_cert_module.html | 4 + branch/main/openssh_keypair_module.html | 4 + .../main/openssl_certificate_info_module.html | 4 + branch/main/openssl_certificate_module.html | 4 + branch/main/openssl_csr_info_filter.html | 4 + branch/main/openssl_csr_info_module.html | 4 + branch/main/openssl_csr_module.html | 4 + branch/main/openssl_csr_pipe_module.html | 4 + branch/main/openssl_dhparam_module.html | 4 + branch/main/openssl_pkcs12_module.html | 4 + .../openssl_privatekey_convert_module.html | 4 + .../main/openssl_privatekey_info_filter.html | 4 + .../main/openssl_privatekey_info_module.html | 4 + branch/main/openssl_privatekey_module.html | 4 + .../main/openssl_privatekey_pipe_module.html | 4 + .../main/openssl_publickey_info_filter.html | 4 + .../main/openssl_publickey_info_module.html | 4 + branch/main/openssl_publickey_module.html | 4 + .../main/openssl_signature_info_module.html | 4 + branch/main/openssl_signature_module.html | 4 + branch/main/parse_serial_filter.html | 4 + branch/main/search.html | 4 + branch/main/searchindex.js | 2 +- branch/main/split_pem_filter.html | 4 + branch/main/to_serial_filter.html | 4 + .../main/x509_certificate_convert_module.html | 4 + branch/main/x509_certificate_info_filter.html | 4 + branch/main/x509_certificate_info_module.html | 4 + branch/main/x509_certificate_module.html | 4 + branch/main/x509_certificate_pipe_module.html | 4 + branch/main/x509_crl_info_filter.html | 4 + branch/main/x509_crl_info_module.html | 4 + branch/main/x509_crl_module.html | 4 + 61 files changed, 3416 insertions(+), 5 deletions(-) create mode 100644 branch/main/acme_certificate_order_create_module.html create mode 100644 branch/main/acme_certificate_order_finalize_module.html create mode 100644 branch/main/acme_certificate_order_info_module.html create mode 100644 branch/main/acme_certificate_order_validate_module.html diff --git a/branch/main/acme_account_facts_module.html b/branch/main/acme_account_facts_module.html index f38e49bc..4df1d916 100644 --- a/branch/main/acme_account_facts_module.html +++ b/branch/main/acme_account_facts_module.html @@ -84,6 +84,10 @@
  • community.crypto.acme_ari_info module – Retrieves ACME Renewal Information (ARI) for a certificate
  • community.crypto.acme_certificate module – Create SSL/TLS certificates with the ACME protocol
  • community.crypto.acme_certificate_deactivate_authz module – Deactivate all authz for an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_create module – Create an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_finalize module – Finalize an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_info module – Obtain information for an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_validate module – Validate authorizations of an ACME v2 order
  • community.crypto.acme_certificate_renewal_info module – Determine whether a certificate should be renewed or not
  • community.crypto.acme_certificate_revoke module – Revoke certificates with the ACME protocol
  • community.crypto.acme_challenge_cert_helper module – Prepare certificates required for ACME challenges such as tls-alpn-01
  • diff --git a/branch/main/acme_account_info_module.html b/branch/main/acme_account_info_module.html index 1c444830..1ba2b266 100644 --- a/branch/main/acme_account_info_module.html +++ b/branch/main/acme_account_info_module.html @@ -100,6 +100,10 @@
  • community.crypto.acme_ari_info module – Retrieves ACME Renewal Information (ARI) for a certificate
  • community.crypto.acme_certificate module – Create SSL/TLS certificates with the ACME protocol
  • community.crypto.acme_certificate_deactivate_authz module – Deactivate all authz for an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_create module – Create an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_finalize module – Finalize an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_info module – Obtain information for an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_validate module – Validate authorizations of an ACME v2 order
  • community.crypto.acme_certificate_renewal_info module – Determine whether a certificate should be renewed or not
  • community.crypto.acme_certificate_revoke module – Revoke certificates with the ACME protocol
  • community.crypto.acme_challenge_cert_helper module – Prepare certificates required for ACME challenges such as tls-alpn-01
  • diff --git a/branch/main/acme_account_module.html b/branch/main/acme_account_module.html index ddfb269e..00f8dfff 100644 --- a/branch/main/acme_account_module.html +++ b/branch/main/acme_account_module.html @@ -100,6 +100,10 @@
  • community.crypto.acme_ari_info module – Retrieves ACME Renewal Information (ARI) for a certificate
  • community.crypto.acme_certificate module – Create SSL/TLS certificates with the ACME protocol
  • community.crypto.acme_certificate_deactivate_authz module – Deactivate all authz for an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_create module – Create an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_finalize module – Finalize an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_info module – Obtain information for an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_validate module – Validate authorizations of an ACME v2 order
  • community.crypto.acme_certificate_renewal_info module – Determine whether a certificate should be renewed or not
  • community.crypto.acme_certificate_revoke module – Revoke certificates with the ACME protocol
  • community.crypto.acme_challenge_cert_helper module – Prepare certificates required for ACME challenges such as tls-alpn-01
  • diff --git a/branch/main/acme_ari_info_module.html b/branch/main/acme_ari_info_module.html index 5662105b..1729a572 100644 --- a/branch/main/acme_ari_info_module.html +++ b/branch/main/acme_ari_info_module.html @@ -100,6 +100,10 @@
  • community.crypto.acme_certificate module – Create SSL/TLS certificates with the ACME protocol
  • community.crypto.acme_certificate_deactivate_authz module – Deactivate all authz for an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_create module – Create an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_finalize module – Finalize an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_info module – Obtain information for an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_validate module – Validate authorizations of an ACME v2 order
  • community.crypto.acme_certificate_renewal_info module – Determine whether a certificate should be renewed or not
  • community.crypto.acme_certificate_revoke module – Revoke certificates with the ACME protocol
  • community.crypto.acme_challenge_cert_helper module – Prepare certificates required for ACME challenges such as tls-alpn-01
  • diff --git a/branch/main/acme_certificate_deactivate_authz_module.html b/branch/main/acme_certificate_deactivate_authz_module.html index 3b1daa2a..dae67a34 100644 --- a/branch/main/acme_certificate_deactivate_authz_module.html +++ b/branch/main/acme_certificate_deactivate_authz_module.html @@ -22,7 +22,7 @@ - + @@ -99,6 +99,10 @@ +
  • community.crypto.acme_certificate_order_create module – Create an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_finalize module – Finalize an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_info module – Obtain information for an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_validate module – Validate authorizations of an ACME v2 order
  • community.crypto.acme_certificate_renewal_info module – Determine whether a certificate should be renewed or not
  • community.crypto.acme_certificate_revoke module – Revoke certificates with the ACME protocol
  • community.crypto.acme_challenge_cert_helper module – Prepare certificates required for ACME challenges such as tls-alpn-01
  • @@ -443,7 +447,7 @@ see - +
    diff --git a/branch/main/acme_certificate_module.html b/branch/main/acme_certificate_module.html index 7a6860d1..f56a2b45 100644 --- a/branch/main/acme_certificate_module.html +++ b/branch/main/acme_certificate_module.html @@ -100,6 +100,10 @@
  • community.crypto.acme_certificate_deactivate_authz module – Deactivate all authz for an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_create module – Create an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_finalize module – Finalize an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_info module – Obtain information for an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_validate module – Validate authorizations of an ACME v2 order
  • community.crypto.acme_certificate_renewal_info module – Determine whether a certificate should be renewed or not
  • community.crypto.acme_certificate_revoke module – Revoke certificates with the ACME protocol
  • community.crypto.acme_challenge_cert_helper module – Prepare certificates required for ACME challenges such as tls-alpn-01
  • diff --git a/branch/main/acme_certificate_order_create_module.html b/branch/main/acme_certificate_order_create_module.html new file mode 100644 index 00000000..d7fa670d --- /dev/null +++ b/branch/main/acme_certificate_order_create_module.html @@ -0,0 +1,820 @@ + + + + + + + + + + community.crypto.acme_certificate_order_create module – Create an ACME v2 order — Community.Crypto Collection documentation + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    Community.Crypto Collection Docs
    +
    +
    + + +
    + +
    +
    +
    +
      +
    • + +
    • + + Edit on GitHub +
    • +
    +
    +
    +
    + + +
    + +
    +

    community.crypto.acme_certificate_order_create module – Create an ACME v2 order

    +
    +

    Note

    +

    This module is part of the community.crypto collection (version 2.24.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.acme_certificate_order_create.

    +
    +

    New in community.crypto 2.24.0

    + +
    +

    Synopsis

    + +
    +
    +

    Requirements

    +

    The below requirements are needed on the host that executes this module.

    + +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Parameter

    Comments

    +

    account_key_content

    +

    string

    +

    Content of the ACME account RSA or Elliptic Curve key.

    +

    Mutually exclusive with account_key_src.

    +

    Required if account_key_src is not used.

    +

    Warning: the content will be written into a temporary file, which will be deleted by Ansible when the module completes. Since this is an important private key — it can be used to change the account key, or to revoke your certificates without knowing their private keys —, this might not be acceptable.

    +

    In case cryptography is used, the content is not written into a temporary file. It can still happen that it is written to disk by Ansible in the process of moving the module with its argument to the node where it is executed.

    +
    +

    account_key_passphrase

    +

    string

    +

    added in community.crypto 1.6.0

    +

    Phassphrase to use to decode the account key.

    +

    Note: this is not supported by the openssl backend, only by the cryptography backend.

    +
    +
    +

    account_key_src

    +

    aliases: account_key

    +

    path

    +

    Path to a file containing the ACME account RSA or Elliptic Curve key.

    +

    Private keys can be created with the community.crypto.openssl_privatekey or community.crypto.openssl_privatekey_pipe modules. If the requisite (cryptography) is not available, keys can also be created directly with the openssl command line tool: RSA keys can be created with openssl genrsa .... Elliptic curve keys can be created with openssl ecparam -genkey .... Any other tool creating private keys in PEM format can be used as well.

    +

    Mutually exclusive with account_key_content.

    +

    Required if account_key_content is not used.

    +
    +

    account_uri

    +

    string

    +

    If specified, assumes that the account URI is as given. If the account key does not match this account, or an account with this URI does not exist, the module fails.

    +
    +

    acme_directory

    +

    string / required

    +

    The ACME directory to use. This is the entry point URL to access the ACME CA server API.

    +

    For safety reasons the default is set to the Let’s Encrypt staging server (for the ACME v1 protocol). This will create technically correct, but untrusted certificates.

    +

    For Let’s Encrypt, all staging endpoints can be found here: https://letsencrypt.org/docs/staging-environment/. For Buypass, all endpoints can be found here: https://community.buypass.com/t/63d4ay/buypass-go-ssl-endpoints.

    +

    For Let’s Encrypt, the production directory URL for ACME v2 is https://acme-v02.api.letsencrypt.org/directory.

    +

    For Buypass, the production directory URL for ACME v2 and v1 is https://api.buypass.com/acme/directory.

    +

    For ZeroSSL, the production directory URL for ACME v2 is https://acme.zerossl.com/v2/DV90.

    +

    For Sectigo, the production directory URL for ACME v2 is https://acme-qa.secure.trust-provider.com/v2/DV.

    +

    The notes for this module contain a list of ACME services this module has been tested against.

    +
    +

    acme_version

    +

    integer / required

    +

    The ACME version of the endpoint.

    +

    Must be 1 for the classic Let’s Encrypt and Buypass ACME endpoints, or 2 for standardized ACME v2 endpoints.

    +

    The value 1 is deprecated since community.crypto 2.0.0 and will be removed from community.crypto 3.0.0.

    +

    Choices:

    +
      +
    • 1

    • +
    • 2

    • +
    +
    +

    csr

    +

    path

    +

    File containing the CSR for the new certificate.

    +

    Can be created with community.crypto.openssl_csr.

    +

    The CSR may contain multiple Subject Alternate Names, but each one will lead to an individual challenge that must be fulfilled for the CSR to be signed.

    +

    Note: the private key used to create the CSR must not be the account key. This is a bad idea from a security point of view, and the CA should not accept the CSR. The ACME server should return an error in this case.

    +

    Precisely one of csr or csr_content must be specified.

    +
    +

    csr_content

    +

    string

    +

    Content of the CSR for the new certificate.

    +

    Can be created with community.crypto.openssl_csr_pipe.

    +

    The CSR may contain multiple Subject Alternate Names, but each one will lead to an individual challenge that must be fulfilled for the CSR to be signed.

    +

    Note: the private key used to create the CSR must not be the account key. This is a bad idea from a security point of view, and the CA should not accept the CSR. The ACME server should return an error in this case.

    +

    Precisely one of csr or csr_content must be specified.

    +
    +

    deactivate_authzs

    +

    boolean

    +

    Deactivate authentication objects (authz) when issuing the certificate failed.

    +

    Authentication objects are bound to an account key and remain valid for a certain amount of time, and can be used to issue certificates without having to re-authenticate the domain. This can be a security concern.

    +

    Choices:

    +
      +
    • false

    • +
    • true ← (default)

    • +
    +
    +

    profile

    +

    string

    +

    Chose a specific profile for certificate selection. The available profiles depend on the CA.

    +

    See a blog post by Let’s Encrypt and draft-aaron-acme-profiles-00 for more information.

    +
    +

    replaces_cert_id

    +

    string

    +

    If provided, will request the order to replace the certificate identified by this certificate ID according to the ACME ARI draft 3.

    +

    This certificate ID must be computed as specified in the ACME ARI draft 3. It is returned as cert_id of the community.crypto.acme_certificate_renewal_info module.

    +

    ACME servers might refuse to create new orders that indicate to replace a certificate for which an active replacement order already exists. This can happen if this module is used to create an order, and then the playbook/role fails in case the challenges cannot be set up. If the playbook/role does not record the order data to continue with the existing order, but tries to create a new one on the next run, creating the new order might fail. For this reason, this option should only be used if the role/playbook using it keeps track of order data accross restarts, or if it takes care to deactivate orders whose processing is aborted. Orders can be deactivated with the community.crypto.acme_certificate_deactivate_authz module.

    +
    +

    request_timeout

    +

    integer

    +

    added in community.crypto 2.3.0

    +

    The time Ansible should wait for a response from the ACME API.

    +

    This timeout is applied to all HTTP(S) requests (HEAD, GET, POST).

    +

    Default: 10

    +
    +

    select_crypto_backend

    +

    string

    +

    Determines which crypto backend to use.

    +

    The default choice is auto, which tries to use cryptography if available, and falls back to openssl.

    +

    If set to openssl, will try to use the openssl binary.

    +

    If set to cryptography, will try to use the cryptography library.

    +

    Choices:

    +
      +
    • "auto" ← (default)

    • +
    • "cryptography"

    • +
    • "openssl"

    • +
    +
    +

    validate_certs

    +

    boolean

    +

    Whether calls to the ACME directory will validate TLS certificates.

    +

    Warning: Should only ever be set to false for testing purposes, for example when testing against a local Pebble server.

    +

    Choices:

    +
      +
    • false

    • +
    • true ← (default)

    • +
    +
    +
    +
    +

    Attributes

    + + + + + + + + + + + + + + + + + + + + + + + + + +

    Attribute

    Support

    Description

    +

    action_group

    +

    Action groups: community.crypto.acme, acme

    +

    Use group/acme or group/community.crypto.acme in module_defaults to set defaults for this module.

    +
    +

    check_mode

    +

    Support: none

    +

    Can run in check_mode and return changed status prediction without modifying target.

    +
    +

    diff_mode

    +

    Support: none

    +

    Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

    +
    +

    idempotent

    +

    Support: none

    +

    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.

    +
    +
    +
    +

    Notes

    +
    +

    Note

    +
      +
    • Although the defaults are chosen so that the module can be used with the Let’s Encrypt CA, the module can in principle be used with any CA providing an ACME endpoint, such as Buypass Go SSL.

    • +
    • So far, the ACME modules have only been tested by the developers against Let’s Encrypt (staging and production), Buypass (staging and production), ZeroSSL (production), and Pebble testing server. We have got community feedback that they also work with Sectigo ACME Service for InCommon. If you experience problems with another ACME server, please create an issue to help us supporting it. Feedback that an ACME server not mentioned does work is also appreciated.

    • +
    • If a new enough version of the cryptography library is available (see Requirements for details), it will be used instead of the openssl binary. This can be explicitly disabled or enabled with the select_crypto_backend option. Note that using the openssl binary will be slower and less secure, as private key contents always have to be stored on disk (see account_key_content).

    • +
    +
    +
    +
    +

    See Also

    +
    +

    See also

    +
    +
    community.crypto.acme_certificate_order_validate

    Validate pending authorizations of an ACME order.

    +
    +
    community.crypto.acme_certificate_order_finalize

    Finalize an ACME order after satisfying the challenges.

    +
    +
    community.crypto.acme_certificate_order_info

    Obtain information for an ACME order.

    +
    +
    community.crypto.acme_certificate_deactivate_authz

    Deactivate all authorizations (authz) of an ACME order, effectively deactivating the order itself.

    +
    +
    community.crypto.acme_certificate_renewal_info

    Determine whether a certificate should be renewed.

    +
    +
    The Let’s Encrypt documentation

    Documentation for the Let’s Encrypt Certification Authority. Provides useful information for example on rate limits.

    +
    +
    Buypass Go SSL

    Documentation for the Buypass Certification Authority. Provides useful information for example on rate limits.

    +
    +
    Automatic Certificate Management Environment (ACME)

    The specification of the ACME protocol (RFC 8555).

    +
    +
    ACME TLS ALPN Challenge Extension

    The specification of the tls-alpn-01 challenge (RFC 8737).

    +
    +
    community.crypto.acme_challenge_cert_helper

    Helps preparing tls-alpn-01 challenges.

    +
    +
    community.crypto.openssl_privatekey

    Can be used to create private keys (both for certificates and accounts).

    +
    +
    community.crypto.openssl_privatekey_pipe

    Can be used to create private keys without writing it to disk (both for certificates and accounts).

    +
    +
    community.crypto.openssl_csr

    Can be used to create a Certificate Signing Request (CSR).

    +
    +
    community.crypto.openssl_csr_pipe

    Can be used to create a Certificate Signing Request (CSR) without writing it to disk.

    +
    +
    community.crypto.acme_account

    Allows to create, modify or delete an ACME account.

    +
    +
    community.crypto.acme_inspect

    Allows to debug problems.

    +
    +
    +
    +
    +
    +

    Examples

    +
    ### Example with HTTP-01 challenge ###
    +
    +- name: Create a challenge for sample.com using a account key from a variable
    +  community.crypto.acme_certificate_order_create:
    +    account_key_content: "{{ account_private_key }}"
    +    csr: /etc/pki/cert/csr/sample.com.csr
    +  register: sample_com_challenge
    +
    +# Alternative first step:
    +- name: Create a challenge for sample.com using a account key from Hashi Vault
    +  community.crypto.acme_certificate_order_create:
    +    account_key_content: >-
    +      {{ lookup('community.hashi_vault.hashi_vault', 'secret=secret/account_private_key:value') }}
    +    csr: /etc/pki/cert/csr/sample.com.csr
    +  register: sample_com_challenge
    +
    +# Alternative first step:
    +- name: Create a challenge for sample.com using a account key file
    +  community.crypto.acme_certificate_order_create:
    +    account_key_src: /etc/pki/cert/private/account.key
    +    csr_content: "{{ lookup('file', '/etc/pki/cert/csr/sample.com.csr') }}"
    +  register: sample_com_challenge
    +
    +# Perform the necessary steps to fulfill the challenge. For example:
    +#
    +# - name: Copy http-01 challenges
    +#   ansible.builtin.copy:
    +#     dest: /var/www/{{ item.identifier }}/{{ item.challenges['http-01'].resource }}
    +#     content: "{{ item.challenges['http-01'].resource_value }}"
    +#   loop: "{{ sample_com_challenge.challenge_data }}"
    +#   when: "'http-01' in item.challenges"
    +
    +- name: Let the challenge be validated
    +  community.crypto.acme_certificate_order_validate:
    +    account_key_src: /etc/pki/cert/private/account.key
    +    order_uri: "{{ sample_com_challenge.order_uri }}"
    +    challenge: http-01
    +
    +- name: Retrieve the cert and intermediate certificate
    +  community.crypto.acme_certificate_order_finalize:
    +    account_key_src: /etc/pki/cert/private/account.key
    +    csr: /etc/pki/cert/csr/sample.com.csr
    +    order_uri: "{{ sample_com_challenge.order_uri }}"
    +    cert_dest: /etc/httpd/ssl/sample.com.crt
    +    fullchain_dest: /etc/httpd/ssl/sample.com-fullchain.crt
    +    chain_dest: /etc/httpd/ssl/sample.com-intermediate.crt
    +
    +### Example with DNS challenge against production ACME server ###
    +
    +- name: Create a challenge for sample.com using a account key file.
    +  community.crypto.acme_certificate_order_create:
    +    acme_directory: https://acme-v01.api.letsencrypt.org/directory
    +    acme_version: 2
    +    account_key_src: /etc/pki/cert/private/account.key
    +    csr: /etc/pki/cert/csr/sample.com.csr
    +  register: sample_com_challenge
    +
    +# Perform the necessary steps to fulfill the challenge. For example:
    +#
    +# - name: Create DNS records for dns-01 challenges
    +#   community.aws.route53:
    +#     zone: sample.com
    +#     record: "{{ item.key }}"
    +#     type: TXT
    +#     ttl: 60
    +#     state: present
    +#     wait: true
    +#     # Note: item.value is a list of TXT entries, and route53
    +#     # requires every entry to be enclosed in quotes
    +#     value: "{{ item.value | map('community.dns.quote_txt', always_quote=true) | list }}"
    +#   loop: "{{ sample_com_challenge.challenge_data_dns | dict2items }}"
    +
    +- name: Let the challenge be validated
    +  community.crypto.acme_certificate_order_validate:
    +    acme_directory: https://acme-v01.api.letsencrypt.org/directory
    +    acme_version: 2
    +    account_key_src: /etc/pki/cert/private/account.key
    +    order_uri: "{{ sample_com_challenge.order_uri }}"
    +    challenge: dns-01
    +
    +- name: Retrieve the cert and intermediate certificate
    +  community.crypto.acme_certificate_order_finalize:
    +    acme_directory: https://acme-v01.api.letsencrypt.org/directory
    +    acme_version: 2
    +    account_key_src: /etc/pki/cert/private/account.key
    +    csr: /etc/pki/cert/csr/sample.com.csr
    +    order_uri: "{{ sample_com_challenge.order_uri }}"
    +    cert_dest: /etc/httpd/ssl/sample.com.crt
    +    fullchain_dest: /etc/httpd/ssl/sample.com-fullchain.crt
    +    chain_dest: /etc/httpd/ssl/sample.com-intermediate.crt
    +
    +
    +
    +
    +

    Return Values

    +

    Common return values are documented here, the following are the fields unique to this module:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Key

    Description

    +

    account_uri

    +

    string

    +

    ACME account URI.

    +

    Returned: success

    +
    +

    challenge_data

    +

    list / elements=dictionary

    +

    For every identifier, provides the challenge information.

    +

    Only challenges which are not yet valid are returned.

    +

    Returned: changed

    +
    +

    challenges

    +

    dictionary

    +

    Information for different challenge types supported for this identifier.

    +

    Returned: success

    +
    +

    dns-01

    +

    dictionary

    +

    Information for dns-01 authorization.

    +

    A DNS TXT record needs to be created with the record name challenge_data[].challenges.dns-01.record and value challenge_data[].challenges.dns-01.resource_value.

    +

    Returned: if the identifier supports dns-01 authorization

    +
    +

    record

    +

    string

    +

    The full DNS record’s name for the challenge.

    +

    Returned: success

    +

    Sample: "_acme-challenge.example.com"

    +
    +

    resource

    +

    string

    +

    Always contains the string _acme-challenge.

    +

    Returned: success

    +

    Sample: "_acme-challenge"

    +
    +

    resource_value

    +

    string

    +

    The value the resource has to produce for the validation.

    +

    Returned: success

    +

    Sample: "IlirfxKKXA...17Dt3juxGJ-PCt92wr-oA"

    +
    +

    http-01

    +

    dictionary

    +

    Information for http-01 authorization.

    +

    The server needs to make the path challenge_data[].challenges.http-01.resource accessible via HTTP (which might redirect to HTTPS). A GET operation to this path needs to provide the value from challenge_data[].challenges.http-01.resource_value.

    +

    Returned: if the identifier supports http-01 authorization

    +
    +

    resource

    +

    string

    +

    The path the value has to be provided under.

    +

    Returned: success

    +

    Sample: ".well-known/acme-challenge/evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA"

    +
    +

    resource_value

    +

    string

    +

    The value the resource has to produce for the validation.

    +

    Returned: success

    +

    Sample: "IlirfxKKXA...17Dt3juxGJ-PCt92wr-oA"

    +
    +

    tls-alpn-01

    +

    dictionary

    +

    Information for tls-alpn-01 authorization.

    +

    A certificate needs to be created for the DNS name challenge_data[].challenges.tls-alpn-01.resource with acmeValidation X.509 extension of value challenge_data[].challenges.tls-alpn-01.resource_value. This certificate needs to be served when the application-layer protocol acme-tls/1 is negotiated for a HTTPS connection to port 443 with the SNI extension for the domain name (challenge_data[].challenges.tls-alpn-01.resource_original) being validated.

    +

    See https://www.rfc-editor.org/rfc/rfc8737.html#section-3 for details.

    +

    Returned: if the identifier supports tls-alpn-01 authorization

    +
    +

    resource

    +

    string

    +

    The DNS name for DNS identifiers, and the reverse DNS mapping (RFC1034, RFC3596) for IP addresses.

    +

    Returned: success

    +

    Sample: "example.com"

    +
    +

    resource_original

    +

    string

    +

    The original identifier including type identifier.

    +

    Returned: success

    +

    Sample: "dns:example.com"

    +
    +

    resource_value

    +

    string

    +

    The value the resource has to produce for the validation.

    +

    Note: this return value contains a Base64 encoded version of the correct binary blob which has to be put into the acmeValidation X.509 extension; see https://www.rfc-editor.org/rfc/rfc8737.html#section-3 for details. To do this, you might need the ansible.builtin.b64decode Jinja filter to extract the binary blob from this return value.

    +

    Returned: success

    +

    Sample: "AAb="

    +
    +

    identifier

    +

    string

    +

    The identifier for this challenge.

    +

    Returned: success

    +

    Sample: "example.com"

    +
    +

    identifier_type

    +

    string

    +

    The identifier’s type.

    +

    dns for DNS names, and ip for IP addresses.

    +

    Returned: success

    +

    Can only return:

    +
      +
    • "dns"

    • +
    • "ip"

    • +
    +

    Sample: "dns"

    +
    +

    challenge_data_dns

    +

    dictionary

    +

    List of TXT values per DNS record for dns-01 challenges.

    +

    Only challenges which are not yet valid are returned.

    +

    Returned: success

    +
    +

    order_uri

    +

    string

    +

    ACME order URI.

    +

    Returned: success

    +
    +
    +

    Authors

    +
      +
    • Felix Fontein (@felixfontein)

    • +
    +
    + +
    +
    + + +
    +
    + + +
    + +
    + +
    +

    © Copyright Community.Crypto Contributors.

    +
    + + + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/branch/main/acme_certificate_order_finalize_module.html b/branch/main/acme_certificate_order_finalize_module.html new file mode 100644 index 00000000..9d61a5bb --- /dev/null +++ b/branch/main/acme_certificate_order_finalize_module.html @@ -0,0 +1,808 @@ + + + + + + + + + + community.crypto.acme_certificate_order_finalize module – Finalize an ACME v2 order — Community.Crypto Collection documentation + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    Community.Crypto Collection Docs
    +
    +
    + + +
    + +
    +
    +
    +
      +
    • + +
    • + + Edit on GitHub +
    • +
    +
    +
    +
    + + +
    + +
    +

    community.crypto.acme_certificate_order_finalize module – Finalize an ACME v2 order

    +
    +

    Note

    +

    This module is part of the community.crypto collection (version 2.24.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.acme_certificate_order_finalize.

    +
    +

    New in community.crypto 2.24.0

    + +
    +

    Synopsis

    + +
    +
    +

    Requirements

    +

    The below requirements are needed on the host that executes this module.

    + +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Parameter

    Comments

    +

    account_key_content

    +

    string

    +

    Content of the ACME account RSA or Elliptic Curve key.

    +

    Mutually exclusive with account_key_src.

    +

    Required if account_key_src is not used.

    +

    Warning: the content will be written into a temporary file, which will be deleted by Ansible when the module completes. Since this is an important private key — it can be used to change the account key, or to revoke your certificates without knowing their private keys —, this might not be acceptable.

    +

    In case cryptography is used, the content is not written into a temporary file. It can still happen that it is written to disk by Ansible in the process of moving the module with its argument to the node where it is executed.

    +
    +

    account_key_passphrase

    +

    string

    +

    added in community.crypto 1.6.0

    +

    Phassphrase to use to decode the account key.

    +

    Note: this is not supported by the openssl backend, only by the cryptography backend.

    +
    +
    +

    account_key_src

    +

    aliases: account_key

    +

    path

    +

    Path to a file containing the ACME account RSA or Elliptic Curve key.

    +

    Private keys can be created with the community.crypto.openssl_privatekey or community.crypto.openssl_privatekey_pipe modules. If the requisite (cryptography) is not available, keys can also be created directly with the openssl command line tool: RSA keys can be created with openssl genrsa .... Elliptic curve keys can be created with openssl ecparam -genkey .... Any other tool creating private keys in PEM format can be used as well.

    +

    Mutually exclusive with account_key_content.

    +

    Required if account_key_content is not used.

    +
    +

    account_uri

    +

    string

    +

    If specified, assumes that the account URI is as given. If the account key does not match this account, or an account with this URI does not exist, the module fails.

    +
    +

    acme_directory

    +

    string / required

    +

    The ACME directory to use. This is the entry point URL to access the ACME CA server API.

    +

    For safety reasons the default is set to the Let’s Encrypt staging server (for the ACME v1 protocol). This will create technically correct, but untrusted certificates.

    +

    For Let’s Encrypt, all staging endpoints can be found here: https://letsencrypt.org/docs/staging-environment/. For Buypass, all endpoints can be found here: https://community.buypass.com/t/63d4ay/buypass-go-ssl-endpoints.

    +

    For Let’s Encrypt, the production directory URL for ACME v2 is https://acme-v02.api.letsencrypt.org/directory.

    +

    For Buypass, the production directory URL for ACME v2 and v1 is https://api.buypass.com/acme/directory.

    +

    For ZeroSSL, the production directory URL for ACME v2 is https://acme.zerossl.com/v2/DV90.

    +

    For Sectigo, the production directory URL for ACME v2 is https://acme-qa.secure.trust-provider.com/v2/DV.

    +

    The notes for this module contain a list of ACME services this module has been tested against.

    +
    +

    acme_version

    +

    integer / required

    +

    The ACME version of the endpoint.

    +

    Must be 1 for the classic Let’s Encrypt and Buypass ACME endpoints, or 2 for standardized ACME v2 endpoints.

    +

    The value 1 is deprecated since community.crypto 2.0.0 and will be removed from community.crypto 3.0.0.

    +

    Choices:

    +
      +
    • 1

    • +
    • 2

    • +
    +
    +

    cert_dest

    +

    path

    +

    The destination file for the certificate.

    +
    +

    chain_dest

    +

    path

    +

    If specified, the intermediate certificate will be written to this file.

    +
    +

    csr

    +

    path

    +

    File containing the CSR for the new certificate.

    +

    Can be created with community.crypto.openssl_csr.

    +

    The CSR may contain multiple Subject Alternate Names, but each one will lead to an individual challenge that must be fulfilled for the CSR to be signed.

    +

    Note: the private key used to create the CSR must not be the account key. This is a bad idea from a security point of view, and the CA should not accept the CSR. The ACME server should return an error in this case.

    +

    Precisely one of csr or csr_content must be specified.

    +
    +

    csr_content

    +

    string

    +

    Content of the CSR for the new certificate.

    +

    Can be created with community.crypto.openssl_csr_pipe.

    +

    The CSR may contain multiple Subject Alternate Names, but each one will lead to an individual challenge that must be fulfilled for the CSR to be signed.

    +

    Note: the private key used to create the CSR must not be the account key. This is a bad idea from a security point of view, and the CA should not accept the CSR. The ACME server should return an error in this case.

    +

    Precisely one of csr or csr_content must be specified.

    +
    +

    deactivate_authzs

    +

    string

    +

    Deactivate authentication objects (authz) after issuing a certificate, or when issuing the certificate failed.

    +

    never never deactivates them.

    +

    always always deactivates them in cases of errors or when the certificate was issued.

    +

    on_error only deactivates them in case of errors.

    +

    on_success only deactivates them in case the certificate was successfully issued.

    +

    Authentication objects are bound to an account key and remain valid for a certain amount of time, and can be used to issue certificates without having to re-authenticate the domain. This can be a security concern.

    +

    Choices:

    +
      +
    • "never"

    • +
    • "on_error"

    • +
    • "on_success"

    • +
    • "always" ← (default)

    • +
    +
    +

    fullchain_dest

    +

    path

    +

    The destination file for the full chain (that is, a certificate followed by chain of intermediate certificates).

    +
    +

    order_uri

    +

    string / required

    +

    The order URI provided by order_uri.

    +
    +

    request_timeout

    +

    integer

    +

    added in community.crypto 2.3.0

    +

    The time Ansible should wait for a response from the ACME API.

    +

    This timeout is applied to all HTTP(S) requests (HEAD, GET, POST).

    +

    Default: 10

    +
    +

    retrieve_all_alternates

    +

    boolean

    +

    When set to true, will retrieve all alternate trust chains offered by the ACME CA. These will not be written to disk, but will be returned together with the main chain as all_chains. See the documentation for the all_chains return value for details.

    +

    Choices:

    +
      +
    • false ← (default)

    • +
    • true

    • +
    +
    +

    select_chain

    +

    list / elements=dictionary

    +

    Allows to specify criteria by which an (alternate) trust chain can be selected.

    +

    The list of criteria will be processed one by one until a chain is found matching a criterium. If such a chain is found, it will be used by the module instead of the default chain.

    +

    If a criterium matches multiple chains, the first one matching will be returned. The order is determined by the ordering of the Link headers returned by the ACME server and might not be deterministic.

    +

    Every criterium can consist of multiple different conditions, like select_chain[].issuer and select_chain[].subject. For the criterium to match a chain, all conditions must apply to the same certificate in the chain.

    +

    This option can only be used with the cryptography backend.

    +
    +

    authority_key_identifier

    +

    string

    +

    Checks for the AuthorityKeyIdentifier extension. This is an identifier based on the private key of the issuer of the intermediate certificate.

    +

    The identifier must be of the form C4:A7:B1:A4:7B:2C:71:FA:DB:E1:4B:90:75:FF:C4:15:60:85:89:10.

    +
    +

    issuer

    +

    dictionary

    +

    Allows to specify parts of the issuer of a certificate in the chain must have to be selected.

    +

    If select_chain[].issuer is empty, any certificate will match.

    +

    An example value would be {"commonName": "My Preferred CA Root"}.

    +
    +

    subject

    +

    dictionary

    +

    Allows to specify parts of the subject of a certificate in the chain must have to be selected.

    +

    If select_chain[].subject is empty, any certificate will match.

    +

    An example value would be {"CN": "My Preferred CA Intermediate"}

    +
    +

    subject_key_identifier

    +

    string

    +

    Checks for the SubjectKeyIdentifier extension. This is an identifier based on the private key of the intermediate certificate.

    +

    The identifier must be of the form A8:4A:6A:63:04:7D:DD:BA:E6:D1:39:B7:A6:45:65:EF:F3:A8:EC:A1.

    +
    +

    test_certificates

    +

    string

    +

    Determines which certificates in the chain will be tested.

    +

    all tests all certificates in the chain (excluding the leaf, which is identical in all chains).

    +

    first only tests the first certificate in the chain, that is the one which signed the leaf.

    +

    last only tests the last certificate in the chain, that is the one furthest away from the leaf. Its issuer is the root certificate of this chain.

    +

    Choices:

    +
      +
    • "first"

    • +
    • "last"

    • +
    • "all" ← (default)

    • +
    +
    +

    select_crypto_backend

    +

    string

    +

    Determines which crypto backend to use.

    +

    The default choice is auto, which tries to use cryptography if available, and falls back to openssl.

    +

    If set to openssl, will try to use the openssl binary.

    +

    If set to cryptography, will try to use the cryptography library.

    +

    Choices:

    +
      +
    • "auto" ← (default)

    • +
    • "cryptography"

    • +
    • "openssl"

    • +
    +
    +

    validate_certs

    +

    boolean

    +

    Whether calls to the ACME directory will validate TLS certificates.

    +

    Warning: Should only ever be set to false for testing purposes, for example when testing against a local Pebble server.

    +

    Choices:

    +
      +
    • false

    • +
    • true ← (default)

    • +
    +
    +
    +
    +

    Attributes

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Attribute

    Support

    Description

    +

    action_group

    +

    Action groups: community.crypto.acme, acme

    +

    Use group/acme or group/community.crypto.acme in module_defaults to set defaults for this module.

    +
    +

    check_mode

    +

    Support: none

    +

    Can run in check_mode and return changed status prediction without modifying target.

    +
    +

    diff_mode

    +

    Support: none

    +

    Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

    +
    +

    idempotent

    +

    Support: full

    +

    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.

    +
    +

    safe_file_operations

    +

    Support: full

    +

    Uses Ansible’s strict file operation functions to ensure proper permissions and avoid data corruption.

    +
    +
    +
    +

    Notes

    +
    +

    Note

    +
      +
    • Although the defaults are chosen so that the module can be used with the Let’s Encrypt CA, the module can in principle be used with any CA providing an ACME endpoint, such as Buypass Go SSL.

    • +
    • So far, the ACME modules have only been tested by the developers against Let’s Encrypt (staging and production), Buypass (staging and production), ZeroSSL (production), and Pebble testing server. We have got community feedback that they also work with Sectigo ACME Service for InCommon. If you experience problems with another ACME server, please create an issue to help us supporting it. Feedback that an ACME server not mentioned does work is also appreciated.

    • +
    • If a new enough version of the cryptography library is available (see Requirements for details), it will be used instead of the openssl binary. This can be explicitly disabled or enabled with the select_crypto_backend option. Note that using the openssl binary will be slower and less secure, as private key contents always have to be stored on disk (see account_key_content).

    • +
    +
    +
    +
    +

    See Also

    +
    +

    See also

    +
    +
    community.crypto.acme_certificate_order_create

    Create an ACME order.

    +
    +
    community.crypto.acme_certificate_order_validate

    Validate pending authorizations of an ACME order.

    +
    +
    community.crypto.acme_certificate_order_info

    Obtain information for an ACME order.

    +
    +
    The Let’s Encrypt documentation

    Documentation for the Let’s Encrypt Certification Authority. Provides useful information for example on rate limits.

    +
    +
    Buypass Go SSL

    Documentation for the Buypass Certification Authority. Provides useful information for example on rate limits.

    +
    +
    Automatic Certificate Management Environment (ACME)

    The specification of the ACME protocol (RFC 8555).

    +
    +
    community.crypto.certificate_complete_chain

    Allows to find the root certificate for the returned fullchain.

    +
    +
    community.crypto.acme_certificate_revoke

    Allows to revoke certificates.

    +
    +
    community.crypto.acme_inspect

    Allows to debug problems.

    +
    +
    community.crypto.acme_certificate_deactivate_authz

    Allows to deactivate (invalidate) ACME v2 orders.

    +
    +
    +
    +
    +
    +

    Examples

    +
    ### Example with HTTP-01 challenge ###
    +
    +- name: Create a challenge for sample.com using a account key from a variable
    +  community.crypto.acme_certificate_order_create:
    +    account_key_content: "{{ account_private_key }}"
    +    csr: /etc/pki/cert/csr/sample.com.csr
    +  register: sample_com_challenge
    +
    +# Alternative first step:
    +- name: Create a challenge for sample.com using a account key from Hashi Vault
    +  community.crypto.acme_certificate_order_create:
    +    account_key_content: >-
    +      {{ lookup('community.hashi_vault.hashi_vault', 'secret=secret/account_private_key:value') }}
    +    csr: /etc/pki/cert/csr/sample.com.csr
    +  register: sample_com_challenge
    +
    +# Alternative first step:
    +- name: Create a challenge for sample.com using a account key file
    +  community.crypto.acme_certificate_order_create:
    +    account_key_src: /etc/pki/cert/private/account.key
    +    csr_content: "{{ lookup('file', '/etc/pki/cert/csr/sample.com.csr') }}"
    +  register: sample_com_challenge
    +
    +# Perform the necessary steps to fulfill the challenge. For example:
    +#
    +# - name: Copy http-01 challenges
    +#   ansible.builtin.copy:
    +#     dest: /var/www/{{ item.identifier }}/{{ item.challenges['http-01'].resource }}
    +#     content: "{{ item.challenges['http-01'].resource_value }}"
    +#   loop: "{{ sample_com_challenge.challenge_data }}"
    +#   when: "'http-01' in item.challenges"
    +
    +- name: Let the challenge be validated
    +  community.crypto.acme_certificate_order_validate:
    +    account_key_src: /etc/pki/cert/private/account.key
    +    order_uri: "{{ sample_com_challenge.order_uri }}"
    +    challenge: http-01
    +
    +- name: Retrieve the cert and intermediate certificate
    +  community.crypto.acme_certificate_order_finalize:
    +    account_key_src: /etc/pki/cert/private/account.key
    +    csr: /etc/pki/cert/csr/sample.com.csr
    +    order_uri: "{{ sample_com_challenge.order_uri }}"
    +    cert_dest: /etc/httpd/ssl/sample.com.crt
    +    fullchain_dest: /etc/httpd/ssl/sample.com-fullchain.crt
    +    chain_dest: /etc/httpd/ssl/sample.com-intermediate.crt
    +
    +### Example with DNS challenge against production ACME server ###
    +
    +- name: Create a challenge for sample.com using a account key file.
    +  community.crypto.acme_certificate_order_create:
    +    acme_directory: https://acme-v01.api.letsencrypt.org/directory
    +    acme_version: 2
    +    account_key_src: /etc/pki/cert/private/account.key
    +    csr: /etc/pki/cert/csr/sample.com.csr
    +  register: sample_com_challenge
    +
    +# Perform the necessary steps to fulfill the challenge. For example:
    +#
    +# - name: Create DNS records for dns-01 challenges
    +#   community.aws.route53:
    +#     zone: sample.com
    +#     record: "{{ item.key }}"
    +#     type: TXT
    +#     ttl: 60
    +#     state: present
    +#     wait: true
    +#     # Note: item.value is a list of TXT entries, and route53
    +#     # requires every entry to be enclosed in quotes
    +#     value: "{{ item.value | map('community.dns.quote_txt', always_quote=true) | list }}"
    +#   loop: "{{ sample_com_challenge.challenge_data_dns | dict2items }}"
    +
    +- name: Let the challenge be validated
    +  community.crypto.acme_certificate_order_validate:
    +    acme_directory: https://acme-v01.api.letsencrypt.org/directory
    +    acme_version: 2
    +    account_key_src: /etc/pki/cert/private/account.key
    +    order_uri: "{{ sample_com_challenge.order_uri }}"
    +    challenge: dns-01
    +
    +- name: Retrieve the cert and intermediate certificate
    +  community.crypto.acme_certificate_order_finalize:
    +    acme_directory: https://acme-v01.api.letsencrypt.org/directory
    +    acme_version: 2
    +    account_key_src: /etc/pki/cert/private/account.key
    +    csr: /etc/pki/cert/csr/sample.com.csr
    +    order_uri: "{{ sample_com_challenge.order_uri }}"
    +    cert_dest: /etc/httpd/ssl/sample.com.crt
    +    fullchain_dest: /etc/httpd/ssl/sample.com-fullchain.crt
    +    chain_dest: /etc/httpd/ssl/sample.com-intermediate.crt
    +
    +
    +
    +
    +

    Return Values

    +

    Common return values are documented here, the following are the fields unique to this module:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Key

    Description

    +

    account_uri

    +

    string

    +

    ACME account URI.

    +

    Returned: success

    +
    +

    all_chains

    +

    list / elements=dictionary

    +

    When retrieve_all_alternates=true, the module will query the ACME server for alternate chains. This return value will contain a list of all chains returned, the first entry being the main chain returned by the server.

    +

    See Section 7.4.2 of RFC8555 for details.

    +

    Returned: success and retrieve_all_alternates=true

    +
    +

    cert

    +

    string

    +

    The leaf certificate itself, in PEM format.

    +

    Returned: always

    +
    +

    chain

    +

    string

    +

    The certificate chain, excluding the root, as concatenated PEM certificates.

    +

    Returned: always

    +
    +

    full_chain

    +

    string

    +

    The certificate chain, excluding the root, but including the leaf certificate, as concatenated PEM certificates.

    +

    Returned: always

    +
    +

    selected_chain

    +

    dictionary

    +

    The selected certificate chain.

    +

    If select_chain is not specified, this will be the main chain returned by the ACME server.

    +

    Returned: success

    +
    +

    cert

    +

    string

    +

    The leaf certificate itself, in PEM format.

    +

    Returned: always

    +
    +

    chain

    +

    string

    +

    The certificate chain, excluding the root, as concatenated PEM certificates.

    +

    Returned: always

    +
    +

    full_chain

    +

    string

    +

    The certificate chain, excluding the root, but including the leaf certificate, as concatenated PEM certificates.

    +

    Returned: always

    +
    +
    +

    Authors

    +
      +
    • Felix Fontein (@felixfontein)

    • +
    +
    + +
    +
    + + +
    +
    + + +
    + +
    + +
    +

    © Copyright Community.Crypto Contributors.

    +
    + + + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/branch/main/acme_certificate_order_info_module.html b/branch/main/acme_certificate_order_info_module.html new file mode 100644 index 00000000..f829d626 --- /dev/null +++ b/branch/main/acme_certificate_order_info_module.html @@ -0,0 +1,865 @@ + + + + + + + + + + community.crypto.acme_certificate_order_info module – Obtain information for an ACME v2 order — Community.Crypto Collection documentation + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    Community.Crypto Collection Docs
    +
    +
    + + +
    + +
    +
    +
    +
      +
    • + +
    • + + Edit on GitHub +
    • +
    +
    +
    +
    + + +
    + +
    +

    community.crypto.acme_certificate_order_info module – Obtain information for an ACME v2 order

    +
    +

    Note

    +

    This module is part of the community.crypto collection (version 2.24.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.acme_certificate_order_info.

    +
    +

    New in community.crypto 2.24.0

    + +
    +

    Synopsis

    + +
    +
    +

    Requirements

    +

    The below requirements are needed on the host that executes this module.

    + +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Parameter

    Comments

    +

    account_key_content

    +

    string

    +

    Content of the ACME account RSA or Elliptic Curve key.

    +

    Mutually exclusive with account_key_src.

    +

    Required if account_key_src is not used.

    +

    Warning: the content will be written into a temporary file, which will be deleted by Ansible when the module completes. Since this is an important private key — it can be used to change the account key, or to revoke your certificates without knowing their private keys —, this might not be acceptable.

    +

    In case cryptography is used, the content is not written into a temporary file. It can still happen that it is written to disk by Ansible in the process of moving the module with its argument to the node where it is executed.

    +
    +

    account_key_passphrase

    +

    string

    +

    added in community.crypto 1.6.0

    +

    Phassphrase to use to decode the account key.

    +

    Note: this is not supported by the openssl backend, only by the cryptography backend.

    +
    +
    +

    account_key_src

    +

    aliases: account_key

    +

    path

    +

    Path to a file containing the ACME account RSA or Elliptic Curve key.

    +

    Private keys can be created with the community.crypto.openssl_privatekey or community.crypto.openssl_privatekey_pipe modules. If the requisite (cryptography) is not available, keys can also be created directly with the openssl command line tool: RSA keys can be created with openssl genrsa .... Elliptic curve keys can be created with openssl ecparam -genkey .... Any other tool creating private keys in PEM format can be used as well.

    +

    Mutually exclusive with account_key_content.

    +

    Required if account_key_content is not used.

    +
    +

    account_uri

    +

    string

    +

    If specified, assumes that the account URI is as given. If the account key does not match this account, or an account with this URI does not exist, the module fails.

    +
    +

    acme_directory

    +

    string / required

    +

    The ACME directory to use. This is the entry point URL to access the ACME CA server API.

    +

    For safety reasons the default is set to the Let’s Encrypt staging server (for the ACME v1 protocol). This will create technically correct, but untrusted certificates.

    +

    For Let’s Encrypt, all staging endpoints can be found here: https://letsencrypt.org/docs/staging-environment/. For Buypass, all endpoints can be found here: https://community.buypass.com/t/63d4ay/buypass-go-ssl-endpoints.

    +

    For Let’s Encrypt, the production directory URL for ACME v2 is https://acme-v02.api.letsencrypt.org/directory.

    +

    For Buypass, the production directory URL for ACME v2 and v1 is https://api.buypass.com/acme/directory.

    +

    For ZeroSSL, the production directory URL for ACME v2 is https://acme.zerossl.com/v2/DV90.

    +

    For Sectigo, the production directory URL for ACME v2 is https://acme-qa.secure.trust-provider.com/v2/DV.

    +

    The notes for this module contain a list of ACME services this module has been tested against.

    +
    +

    acme_version

    +

    integer / required

    +

    The ACME version of the endpoint.

    +

    Must be 1 for the classic Let’s Encrypt and Buypass ACME endpoints, or 2 for standardized ACME v2 endpoints.

    +

    The value 1 is deprecated since community.crypto 2.0.0 and will be removed from community.crypto 3.0.0.

    +

    Choices:

    +
      +
    • 1

    • +
    • 2

    • +
    +
    +

    order_uri

    +

    string / required

    +

    The order URI provided by order_uri.

    +
    +

    request_timeout

    +

    integer

    +

    added in community.crypto 2.3.0

    +

    The time Ansible should wait for a response from the ACME API.

    +

    This timeout is applied to all HTTP(S) requests (HEAD, GET, POST).

    +

    Default: 10

    +
    +

    select_crypto_backend

    +

    string

    +

    Determines which crypto backend to use.

    +

    The default choice is auto, which tries to use cryptography if available, and falls back to openssl.

    +

    If set to openssl, will try to use the openssl binary.

    +

    If set to cryptography, will try to use the cryptography library.

    +

    Choices:

    +
      +
    • "auto" ← (default)

    • +
    • "cryptography"

    • +
    • "openssl"

    • +
    +
    +

    validate_certs

    +

    boolean

    +

    Whether calls to the ACME directory will validate TLS certificates.

    +

    Warning: Should only ever be set to false for testing purposes, for example when testing against a local Pebble server.

    +

    Choices:

    +
      +
    • false

    • +
    • true ← (default)

    • +
    +
    +
    +
    +

    Attributes

    + + + + + + + + + + + + + + + + + + + + + + + + + +

    Attribute

    Support

    Description

    +

    action_group

    +

    Action groups: community.crypto.acme, acme

    +

    Use group/acme or group/community.crypto.acme in module_defaults to set defaults for this module.

    +
    +

    check_mode

    +

    Support: full

    +

    This action does not modify state.

    +

    Can run in check_mode and return changed status prediction without modifying target.

    +
    +

    diff_mode

    +

    Support: N/A

    +

    This action does not modify state.

    +

    Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

    +
    +

    idempotent

    +

    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.

    +
    +
    +
    +

    Notes

    +
    +

    Note

    +
      +
    • Although the defaults are chosen so that the module can be used with the Let’s Encrypt CA, the module can in principle be used with any CA providing an ACME endpoint, such as Buypass Go SSL.

    • +
    • So far, the ACME modules have only been tested by the developers against Let’s Encrypt (staging and production), Buypass (staging and production), ZeroSSL (production), and Pebble testing server. We have got community feedback that they also work with Sectigo ACME Service for InCommon. If you experience problems with another ACME server, please create an issue to help us supporting it. Feedback that an ACME server not mentioned does work is also appreciated.

    • +
    • If a new enough version of the cryptography library is available (see Requirements for details), it will be used instead of the openssl binary. This can be explicitly disabled or enabled with the select_crypto_backend option. Note that using the openssl binary will be slower and less secure, as private key contents always have to be stored on disk (see account_key_content).

    • +
    +
    +
    +
    +

    See Also

    +
    +

    See also

    +
    +
    community.crypto.acme_certificate_order_create

    Create an ACME order.

    +
    +
    community.crypto.acme_certificate_order_validate

    Validate pending authorizations of an ACME order.

    +
    +
    community.crypto.acme_certificate_order_finalize

    Finalize an ACME order after satisfying the challenges.

    +
    +
    Automatic Certificate Management Environment (ACME)

    The specification of the ACME protocol (RFC 8555).

    +
    +
    ACME TLS ALPN Challenge Extension

    The specification of the tls-alpn-01 challenge (RFC 8737).

    +
    +
    community.crypto.acme_inspect

    Allows to debug problems.

    +
    +
    community.crypto.acme_certificate_deactivate_authz

    Allows to deactivate (invalidate) ACME v2 orders.

    +
    +
    +
    +
    +
    +

    Examples

    +
    - name: Create a challenge for sample.com using a account key from a variable
    +  community.crypto.acme_certificate_order_create:
    +    account_key_content: "{{ account_private_key }}"
    +    csr: /etc/pki/cert/csr/sample.com.csr
    +  register: order
    +
    +- name: Obtain information on the order
    +  community.crypto.acme_certificate_order_info:
    +    account_key_src: /etc/pki/cert/private/account.key
    +    order_uri: "{{ order.order_uri }}"
    +  register: order_info
    +
    +- name: Show information
    +  ansible.builtin.debug:
    +    var: order_info
    +
    +
    +
    +
    +

    Return Values

    +

    Common return values are documented here, the following are the fields unique to this module:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Key

    Description

    +

    account_uri

    +

    string

    +

    ACME account URI.

    +

    Returned: success

    +
    +

    authorizations_by_identifier

    +

    dictionary

    +

    A dictionary mapping identifiers to their authorization objects.

    +

    Returned: success

    +
    +

    identifier

    +

    dictionary

    +

    The keys in this dictionary are the identifiers. identifier is a placeholder used in the documentation.

    +

    See https://www.rfc-editor.org/rfc/rfc8555#section-7.1.4 for how authorization objects look like.

    +

    Returned: success

    +
    +

    challenges

    +

    list / elements=dictionary

    +

    For pending authorizations, the challenges that the client can fulfill in order to prove possession of the identifier.

    +

    For valid authorizations, the challenge that was validated.

    +

    For invalid authorizations, the challenge that was attempted and failed.

    +

    Each array entry is an object with parameters required to validate the challenge. A client should attempt to fulfill one of these challenges, and a server should consider any one of the challenges sufficient to make the authorization valid.

    +

    See https://www.rfc-editor.org/rfc/rfc8555#section-8 for the general structure. The structure of every entry depends on the challenge’s type. For tls-alpn-01 challenges, the structure is defined in https://www.rfc-editor.org/rfc/rfc8737.html#section-3.

    +

    Returned: always

    +
    +

    error

    +

    dictionary

    +

    Error that occurred while the server was validating the challenge, if any.

    +

    This field is structured as a problem document according to RFC 7807.

    +

    Returned: always if authorizations_by_identifier.identifier.challenges[].type=invalid, otherwise in some situations

    +
    +

    status

    +

    string

    +

    The status of this challenge.

    +

    See https://www.rfc-editor.org/rfc/rfc8555#section-7.1.6 for state changes.

    +

    Returned: always

    +

    Can only return:

    +
      +
    • "pending"

    • +
    • "processing"

    • +
    • "valid"

    • +
    • "invalid"

    • +
    +
    +

    type

    +

    string

    +

    The type of challenge encoded in the object.

    +

    Returned: always

    +

    Can only return:

    +
      +
    • "http-01"

    • +
    • "dns-01"

    • +
    • "tls-alpn-01"

    • +
    +
    +

    url

    +

    string

    +

    The URL to which a response can be posted.

    +

    Returned: always

    +
    +

    validated

    +

    string

    +

    The time at which the server validated this challenge.

    +

    Encoded in the format specified in RFC 3339.

    +

    Returned: always if authorizations_by_identifier.identifier.challenges[].type=valid, otherwise in some situations

    +
    +

    expires

    +

    string

    +

    The timestamp after which the server will consider this authorization invalid.

    +

    Encoded in the format specified in RFC 3339.

    +

    Returned: if authorizations_by_identifier.identifier.status=valid, and sometimes in other situations

    +
    +

    identifier

    +

    dictionary

    +

    The identifier that the account is authorized to represent.

    +

    Returned: always

    +
    +

    type

    +

    string

    +

    The type of identifier.

    +

    So far dns and ip are defined values.

    +

    Returned: always

    +

    Can only return:

    +
      +
    • "dns"

    • +
    • "ip"

    • +
    +

    Sample: "dns"

    +
    +

    value

    +

    string

    +

    The identifier itself.

    +

    Returned: always

    +

    Sample: "example.com"

    +
    +

    status

    +

    string

    +

    The status of this authorization.

    +

    See https://www.rfc-editor.org/rfc/rfc8555#section-7.1.6 for state changes.

    +

    Returned: always

    +

    Can only return:

    +
      +
    • "pending"

    • +
    • "valid"

    • +
    • "invalid"

    • +
    • "deactivated"

    • +
    • "expired"

    • +
    • "revoked"

    • +
    +
    +

    wildcard

    +

    boolean

    +

    This field must be present and true for authorizations created as a result of a newOrder request containing a DNS identifier with a value that was a wildcard domain name. For other authorizations, it must be absent.

    +

    Wildcard domain names are described in https://www.rfc-editor.org/rfc/rfc8555#section-7.1.3 of the ACME specification.

    +

    Returned: sometimes

    +
    +

    authorizations_by_status

    +

    dictionary

    +

    For every status, a list of identifiers whose authorizations have this status.

    +

    Returned: success

    +
    +

    deactivated

    +

    list / elements=string

    +

    A list of all identifiers whose authorizations are in the deactivated state.

    +

    See https://www.rfc-editor.org/rfc/rfc8555#section-7.1.6 for state changes of authorizations.

    +

    Returned: always

    +
    +

    expired

    +

    list / elements=string

    +

    A list of all identifiers whose authorizations are in the expired state.

    +

    See https://www.rfc-editor.org/rfc/rfc8555#section-7.1.6 for state changes of authorizations.

    +

    Returned: always

    +
    +

    invalid

    +

    list / elements=string

    +

    A list of all identifiers whose authorizations are in the invalid state.

    +

    See https://www.rfc-editor.org/rfc/rfc8555#section-7.1.6 for state changes of authorizations.

    +

    Returned: always

    +
    +

    pending

    +

    list / elements=string

    +

    A list of all identifiers whose authorizations are in the pending state.

    +

    See https://www.rfc-editor.org/rfc/rfc8555#section-7.1.6 for state changes of authorizations.

    +

    Returned: always

    +
    +

    revoked

    +

    list / elements=string

    +

    A list of all identifiers whose authorizations are in the revoked state.

    +

    See https://www.rfc-editor.org/rfc/rfc8555#section-7.1.6 for state changes of authorizations.

    +

    Returned: always

    +
    +

    valid

    +

    list / elements=string

    +

    A list of all identifiers whose authorizations are in the valid state.

    +

    See https://www.rfc-editor.org/rfc/rfc8555#section-7.1.6 for state changes of authorizations.

    +

    Returned: always

    +
    +

    order

    +

    dictionary

    +

    The order object.

    +

    See https://www.rfc-editor.org/rfc/rfc8555#section-7.1.3 for its specification.

    +

    Returned: success

    +
    +

    authorizations

    +

    list / elements=string

    +

    For pending orders, the authorizations that the client needs to complete before the requested certificate can be issued, including unexpired authorizations that the client has completed in the past for identifiers specified in the order.

    +

    The authorizations required are dictated by server policy; there may not be a 1:1 relationship between the order identifiers and the authorizations required.

    +

    For final orders (in the valid or invalid state), the authorizations that were completed. Each entry is a URL from which an authorization can be fetched with a POST-as-GET request.

    +

    The authorizations themselves are returned as authorizations_by_identifier.

    +

    Returned: always

    +
    +

    certificate

    +

    string

    +

    A URL for the certificate that has been issued in response to this order.

    +

    Returned: when the certificate has been issued

    +
    +

    error

    +

    dictionary

    +

    The error that occurred while processing the order, if any.

    +

    This field is structured as a problem document according to RFC 7807.

    +

    Returned: sometimes

    +
    +

    expires

    +

    string

    +

    The timestamp after which the server will consider this order invalid.

    +

    Encoded in the format specified in RFC 3339.

    +

    Returned: if order.status is pending or valid, and sometimes in other situations

    +
    +

    finalize

    +

    string

    +

    A URL that a CSR must be POSTed to once all of the order’s authorizations are satisfied to finalize the order. The result of a successful finalization will be the population of the certificate URL for the order.

    +

    Returned: always

    +
    +

    identifiers

    +

    list / elements=dictionary

    +

    An array of identifier objects that the order pertains to.

    +

    Returned: always

    +
    +

    type

    +

    string

    +

    The type of identifier.

    +

    So far dns and ip are defined values.

    +

    Returned: always

    +

    Can only return:

    +
      +
    • "dns"

    • +
    • "ip"

    • +
    +

    Sample: "dns"

    +
    +

    value

    +

    string

    +

    The identifier itself.

    +

    Returned: always

    +

    Sample: "example.com"

    +
    +

    notAfter (optional, string)

    +

    string

    +

    The requested value of the notAfter field in the certificate.

    +

    Encoded in the date format defined in RFC 3339.

    +

    Returned: depending on order

    +
    +

    notBefore

    +

    string

    +

    The requested value of the notBefore field in the certificate.

    +

    Encoded in the date format defined in RFC 3339.

    +

    Returned: depending on order

    +
    +

    status

    +

    string

    +

    The status of this order.

    +

    See https://www.rfc-editor.org/rfc/rfc8555#section-7.1.6 for state changes.

    +

    Returned: always

    +

    Can only return:

    +
      +
    • "pending"

    • +
    • "ready"

    • +
    • "processing"

    • +
    • "valid"

    • +
    • "invalid"

    • +
    +
    +

    order_uri

    +

    string

    +

    ACME order URI.

    +

    Returned: success

    +
    +
    +

    Authors

    +
      +
    • Felix Fontein (@felixfontein)

    • +
    +
    + +
    +
    + + +
    +
    + + +
    + +
    + +
    +

    © Copyright Community.Crypto Contributors.

    +
    + + + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/branch/main/acme_certificate_order_validate_module.html b/branch/main/acme_certificate_order_validate_module.html new file mode 100644 index 00000000..364477a1 --- /dev/null +++ b/branch/main/acme_certificate_order_validate_module.html @@ -0,0 +1,694 @@ + + + + + + + + + + community.crypto.acme_certificate_order_validate module – Validate authorizations of an ACME v2 order — Community.Crypto Collection documentation + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    Community.Crypto Collection Docs
    +
    +
    + + +
    + +
    +
    +
    +
      +
    • + +
    • + + Edit on GitHub +
    • +
    +
    +
    +
    + + +
    + +
    +

    community.crypto.acme_certificate_order_validate module – Validate authorizations of an ACME v2 order

    +
    +

    Note

    +

    This module is part of the community.crypto collection (version 2.24.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.acme_certificate_order_validate.

    +
    +

    New in community.crypto 2.24.0

    + +
    +

    Synopsis

    + +
    +
    +

    Requirements

    +

    The below requirements are needed on the host that executes this module.

    + +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Parameter

    Comments

    +

    account_key_content

    +

    string

    +

    Content of the ACME account RSA or Elliptic Curve key.

    +

    Mutually exclusive with account_key_src.

    +

    Required if account_key_src is not used.

    +

    Warning: the content will be written into a temporary file, which will be deleted by Ansible when the module completes. Since this is an important private key — it can be used to change the account key, or to revoke your certificates without knowing their private keys —, this might not be acceptable.

    +

    In case cryptography is used, the content is not written into a temporary file. It can still happen that it is written to disk by Ansible in the process of moving the module with its argument to the node where it is executed.

    +
    +

    account_key_passphrase

    +

    string

    +

    added in community.crypto 1.6.0

    +

    Phassphrase to use to decode the account key.

    +

    Note: this is not supported by the openssl backend, only by the cryptography backend.

    +
    +
    +

    account_key_src

    +

    aliases: account_key

    +

    path

    +

    Path to a file containing the ACME account RSA or Elliptic Curve key.

    +

    Private keys can be created with the community.crypto.openssl_privatekey or community.crypto.openssl_privatekey_pipe modules. If the requisite (cryptography) is not available, keys can also be created directly with the openssl command line tool: RSA keys can be created with openssl genrsa .... Elliptic curve keys can be created with openssl ecparam -genkey .... Any other tool creating private keys in PEM format can be used as well.

    +

    Mutually exclusive with account_key_content.

    +

    Required if account_key_content is not used.

    +
    +

    account_uri

    +

    string

    +

    If specified, assumes that the account URI is as given. If the account key does not match this account, or an account with this URI does not exist, the module fails.

    +
    +

    acme_directory

    +

    string / required

    +

    The ACME directory to use. This is the entry point URL to access the ACME CA server API.

    +

    For safety reasons the default is set to the Let’s Encrypt staging server (for the ACME v1 protocol). This will create technically correct, but untrusted certificates.

    +

    For Let’s Encrypt, all staging endpoints can be found here: https://letsencrypt.org/docs/staging-environment/. For Buypass, all endpoints can be found here: https://community.buypass.com/t/63d4ay/buypass-go-ssl-endpoints.

    +

    For Let’s Encrypt, the production directory URL for ACME v2 is https://acme-v02.api.letsencrypt.org/directory.

    +

    For Buypass, the production directory URL for ACME v2 and v1 is https://api.buypass.com/acme/directory.

    +

    For ZeroSSL, the production directory URL for ACME v2 is https://acme.zerossl.com/v2/DV90.

    +

    For Sectigo, the production directory URL for ACME v2 is https://acme-qa.secure.trust-provider.com/v2/DV.

    +

    The notes for this module contain a list of ACME services this module has been tested against.

    +
    +

    acme_version

    +

    integer / required

    +

    The ACME version of the endpoint.

    +

    Must be 1 for the classic Let’s Encrypt and Buypass ACME endpoints, or 2 for standardized ACME v2 endpoints.

    +

    The value 1 is deprecated since community.crypto 2.0.0 and will be removed from community.crypto 3.0.0.

    +

    Choices:

    +
      +
    • 1

    • +
    • 2

    • +
    +
    +

    challenge

    +

    string

    +

    The challenge to be performed for every pending authorization.

    +

    Must be provided if there is at least one pending authorization.

    +

    In case of authorization reuse, or in case of CAs which use External Account Binding and other means of validating certificate assurance, it might not be necessary to provide this option.

    +

    Choices:

    +
      +
    • "http-01"

    • +
    • "dns-01"

    • +
    • "tls-alpn-01"

    • +
    +
    +

    deactivate_authzs

    +

    boolean

    +

    Deactivate authentication objects (authz) in case an error happens.

    +

    Authentication objects are bound to an account key and remain valid for a certain amount of time, and can be used to issue certificates without having to re-authenticate the domain. This can be a security concern.

    +

    Choices:

    +
      +
    • false

    • +
    • true ← (default)

    • +
    +
    +

    order_uri

    +

    string / required

    +

    The order URI provided by order_uri.

    +
    +

    request_timeout

    +

    integer

    +

    added in community.crypto 2.3.0

    +

    The time Ansible should wait for a response from the ACME API.

    +

    This timeout is applied to all HTTP(S) requests (HEAD, GET, POST).

    +

    Default: 10

    +
    +

    select_crypto_backend

    +

    string

    +

    Determines which crypto backend to use.

    +

    The default choice is auto, which tries to use cryptography if available, and falls back to openssl.

    +

    If set to openssl, will try to use the openssl binary.

    +

    If set to cryptography, will try to use the cryptography library.

    +

    Choices:

    +
      +
    • "auto" ← (default)

    • +
    • "cryptography"

    • +
    • "openssl"

    • +
    +
    +

    validate_certs

    +

    boolean

    +

    Whether calls to the ACME directory will validate TLS certificates.

    +

    Warning: Should only ever be set to false for testing purposes, for example when testing against a local Pebble server.

    +

    Choices:

    +
      +
    • false

    • +
    • true ← (default)

    • +
    +
    +
    +
    +

    Attributes

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Attribute

    Support

    Description

    +

    action_group

    +

    Action groups: community.crypto.acme, acme

    +

    Use group/acme or group/community.crypto.acme in module_defaults to set defaults for this module.

    +
    +

    check_mode

    +

    Support: none

    +

    Can run in check_mode and return changed status prediction without modifying target.

    +
    +

    diff_mode

    +

    Support: none

    +

    Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

    +
    +

    idempotent

    +

    Support: full

    +

    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.

    +
    +

    safe_file_operations

    +

    Support: full

    +

    Uses Ansible’s strict file operation functions to ensure proper permissions and avoid data corruption.

    +
    +
    +
    +

    Notes

    +
    +

    Note

    +
      +
    • Although the defaults are chosen so that the module can be used with the Let’s Encrypt CA, the module can in principle be used with any CA providing an ACME endpoint, such as Buypass Go SSL.

    • +
    • So far, the ACME modules have only been tested by the developers against Let’s Encrypt (staging and production), Buypass (staging and production), ZeroSSL (production), and Pebble testing server. We have got community feedback that they also work with Sectigo ACME Service for InCommon. If you experience problems with another ACME server, please create an issue to help us supporting it. Feedback that an ACME server not mentioned does work is also appreciated.

    • +
    • If a new enough version of the cryptography library is available (see Requirements for details), it will be used instead of the openssl binary. This can be explicitly disabled or enabled with the select_crypto_backend option. Note that using the openssl binary will be slower and less secure, as private key contents always have to be stored on disk (see account_key_content).

    • +
    +
    +
    +
    +

    See Also

    +
    +

    See also

    +
    +
    community.crypto.acme_certificate_order_create

    Create an ACME order.

    +
    +
    community.crypto.acme_certificate_order_finalize

    Finalize an ACME order after satisfying the challenges.

    +
    +
    community.crypto.acme_certificate_order_info

    Obtain information for an ACME order.

    +
    +
    The Let’s Encrypt documentation

    Documentation for the Let’s Encrypt Certification Authority. Provides useful information for example on rate limits.

    +
    +
    Buypass Go SSL

    Documentation for the Buypass Certification Authority. Provides useful information for example on rate limits.

    +
    +
    Automatic Certificate Management Environment (ACME)

    The specification of the ACME protocol (RFC 8555).

    +
    +
    ACME TLS ALPN Challenge Extension

    The specification of the tls-alpn-01 challenge (RFC 8737).

    +
    +
    community.crypto.acme_challenge_cert_helper

    Helps preparing tls-alpn-01 challenges.

    +
    +
    community.crypto.acme_inspect

    Allows to debug problems.

    +
    +
    community.crypto.acme_certificate_deactivate_authz

    Allows to deactivate (invalidate) ACME v2 orders.

    +
    +
    +
    +
    +
    +

    Examples

    +
    ### Example with HTTP-01 challenge ###
    +
    +- name: Create a challenge for sample.com using a account key from a variable
    +  community.crypto.acme_certificate_order_create:
    +    account_key_content: "{{ account_private_key }}"
    +    csr: /etc/pki/cert/csr/sample.com.csr
    +  register: sample_com_challenge
    +
    +# Alternative first step:
    +- name: Create a challenge for sample.com using a account key from Hashi Vault
    +  community.crypto.acme_certificate_order_create:
    +    account_key_content: >-
    +      {{ lookup('community.hashi_vault.hashi_vault', 'secret=secret/account_private_key:value') }}
    +    csr: /etc/pki/cert/csr/sample.com.csr
    +  register: sample_com_challenge
    +
    +# Alternative first step:
    +- name: Create a challenge for sample.com using a account key file
    +  community.crypto.acme_certificate_order_create:
    +    account_key_src: /etc/pki/cert/private/account.key
    +    csr_content: "{{ lookup('file', '/etc/pki/cert/csr/sample.com.csr') }}"
    +  register: sample_com_challenge
    +
    +# Perform the necessary steps to fulfill the challenge. For example:
    +#
    +# - name: Copy http-01 challenges
    +#   ansible.builtin.copy:
    +#     dest: /var/www/{{ item.identifier }}/{{ item.challenges['http-01'].resource }}
    +#     content: "{{ item.challenges['http-01'].resource_value }}"
    +#   loop: "{{ sample_com_challenge.challenge_data }}"
    +#   when: "'http-01' in item.challenges"
    +
    +- name: Let the challenge be validated
    +  community.crypto.acme_certificate_order_validate:
    +    account_key_src: /etc/pki/cert/private/account.key
    +    order_uri: "{{ sample_com_challenge.order_uri }}"
    +    challenge: http-01
    +
    +- name: Retrieve the cert and intermediate certificate
    +  community.crypto.acme_certificate_order_finalize:
    +    account_key_src: /etc/pki/cert/private/account.key
    +    csr: /etc/pki/cert/csr/sample.com.csr
    +    order_uri: "{{ sample_com_challenge.order_uri }}"
    +    cert_dest: /etc/httpd/ssl/sample.com.crt
    +    fullchain_dest: /etc/httpd/ssl/sample.com-fullchain.crt
    +    chain_dest: /etc/httpd/ssl/sample.com-intermediate.crt
    +
    +### Example with DNS challenge against production ACME server ###
    +
    +- name: Create a challenge for sample.com using a account key file.
    +  community.crypto.acme_certificate_order_create:
    +    acme_directory: https://acme-v01.api.letsencrypt.org/directory
    +    acme_version: 2
    +    account_key_src: /etc/pki/cert/private/account.key
    +    csr: /etc/pki/cert/csr/sample.com.csr
    +  register: sample_com_challenge
    +
    +# Perform the necessary steps to fulfill the challenge. For example:
    +#
    +# - name: Create DNS records for dns-01 challenges
    +#   community.aws.route53:
    +#     zone: sample.com
    +#     record: "{{ item.key }}"
    +#     type: TXT
    +#     ttl: 60
    +#     state: present
    +#     wait: true
    +#     # Note: item.value is a list of TXT entries, and route53
    +#     # requires every entry to be enclosed in quotes
    +#     value: "{{ item.value | map('community.dns.quote_txt', always_quote=true) | list }}"
    +#   loop: "{{ sample_com_challenge.challenge_data_dns | dict2items }}"
    +
    +- name: Let the challenge be validated
    +  community.crypto.acme_certificate_order_validate:
    +    acme_directory: https://acme-v01.api.letsencrypt.org/directory
    +    acme_version: 2
    +    account_key_src: /etc/pki/cert/private/account.key
    +    order_uri: "{{ sample_com_challenge.order_uri }}"
    +    challenge: dns-01
    +
    +- name: Retrieve the cert and intermediate certificate
    +  community.crypto.acme_certificate_order_finalize:
    +    acme_directory: https://acme-v01.api.letsencrypt.org/directory
    +    acme_version: 2
    +    account_key_src: /etc/pki/cert/private/account.key
    +    csr: /etc/pki/cert/csr/sample.com.csr
    +    order_uri: "{{ sample_com_challenge.order_uri }}"
    +    cert_dest: /etc/httpd/ssl/sample.com.crt
    +    fullchain_dest: /etc/httpd/ssl/sample.com-fullchain.crt
    +    chain_dest: /etc/httpd/ssl/sample.com-intermediate.crt
    +
    +
    +
    +
    +

    Return Values

    +

    Common return values are documented here, the following are the fields unique to this module:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Key

    Description

    +

    account_uri

    +

    string

    +

    ACME account URI.

    +

    Returned: success

    +
    +

    validating_challenges

    +

    list / elements=dictionary

    +

    List of challenges whose validation was triggered.

    +

    Returned: success

    +
    +

    authz_url

    +

    string

    +

    The URL of the authorization object for this challenge.

    +

    Returned: always

    +
    +

    challenge_type

    +

    string

    +

    The challenge’s type.

    +

    Returned: always

    +

    Can only return:

    +
      +
    • "http-01"

    • +
    • "dns-01"

    • +
    • "tls-alpn-01"

    • +
    +
    +

    challenge_url

    +

    string

    +

    The URL of the challenge object.

    +

    Returned: always

    +
    +

    identifier

    +

    string

    +

    The identifier the challenge is for.

    +

    Returned: always

    +
    +

    identifier_type

    +

    string

    +

    The identifier’s type for the challenge.

    +

    Returned: always

    +

    Can only return:

    +
      +
    • "dns"

    • +
    • "ip"

    • +
    +
    +
    +

    Authors

    +
      +
    • Felix Fontein (@felixfontein)

    • +
    +
    + +
    +
    + + +
    +
    + + +
    + +
    + +
    +

    © Copyright Community.Crypto Contributors.

    +
    + + + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/branch/main/acme_certificate_renewal_info_module.html b/branch/main/acme_certificate_renewal_info_module.html index 85c18b7a..194c3b06 100644 --- a/branch/main/acme_certificate_renewal_info_module.html +++ b/branch/main/acme_certificate_renewal_info_module.html @@ -23,7 +23,7 @@ - + @@ -86,6 +86,10 @@
  • community.crypto.acme_ari_info module – Retrieves ACME Renewal Information (ARI) for a certificate
  • community.crypto.acme_certificate module – Create SSL/TLS certificates with the ACME protocol
  • community.crypto.acme_certificate_deactivate_authz module – Deactivate all authz for an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_create module – Create an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_finalize module – Finalize an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_info module – Obtain information for an ACME v2 order
  • +
  • community.crypto.acme_certificate_order_validate module – Validate authorizations of an ACME v2 order
  • community.crypto.acme_certificate_renewal_info module – Determine whether a certificate should be renewed or not