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).
You might already have this collection installed if you are using the ansible
package.
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
Obtain information for an ACME v2 order. This can be used during the process of obtaining a new certificate with the ACME protocol from a Certificate Authority such as Let’s Encrypt or Buypass. This module does not support ACME v1, the original version of the ACME protocol before standardization.
This module needs to be used in conjunction with the community.crypto.acme_certificate_order_create, community.crypto.acme_certificate_order_validate, and community.crypto.acme_certificate_order_finalize modules.
Requirements
The below requirements are needed on the host that executes this module.
either openssl or cryptography >= 1.5
ipaddress
Parameters
Parameter |
Comments |
---|---|
Content of the ACME account RSA or Elliptic Curve key. Mutually exclusive with Required if 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 |
|
Phassphrase to use to decode the account key. Note: this is not supported by the |
|
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 Mutually exclusive with Required if |
|
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. |
|
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. |
|
The ACME version of the endpoint. Must be The value Choices:
|
|
The order URI provided by |
|
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: |
|
Determines which crypto backend to use. The default choice is If set to If set to Choices:
|
|
Whether calls to the ACME directory will validate TLS certificates. Warning: Should only ever be set to Choices:
|
Attributes
Attribute |
Support |
Description |
---|---|---|
Action groups: community.crypto.acme, acme |
Use |
|
Support: full This action does not modify state. |
Can run in |
|
Support: N/A This action does not modify state. |
Will return details on what has changed (or possibly needs changing in |
|
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 theopenssl
binary. This can be explicitly disabled or enabled with theselect_crypto_backend
option. Note that using theopenssl
binary will be slower and less secure, as private key contents always have to be stored on disk (seeaccount_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 |
---|---|
ACME account URI. Returned: success |
|
A dictionary mapping identifiers to their authorization objects. Returned: success |
|
The keys in this dictionary are the identifiers. See https://www.rfc-editor.org/rfc/rfc8555#section-7.1.4 for how authorization objects look like. Returned: success |
|
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 Returned: always |
|
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 |
|
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:
|
|
The type of challenge encoded in the object. Returned: always Can only return:
|
|
The URL to which a response can be posted. Returned: always |
|
The time at which the server validated this challenge. Encoded in the format specified in RFC 3339. Returned: always if |
|
The timestamp after which the server will consider this authorization invalid. Encoded in the format specified in RFC 3339. Returned: if |
|
The identifier that the account is authorized to represent. Returned: always |
|
The type of identifier. So far Returned: always Can only return:
Sample: |
|
The identifier itself. Returned: always Sample: |
|
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:
|
|
This field must be present and true for authorizations created as a result of a Wildcard domain names are described in https://www.rfc-editor.org/rfc/rfc8555#section-7.1.3 of the ACME specification. Returned: sometimes |
|
For every status, a list of identifiers whose authorizations have this status. Returned: success |
|
A list of all identifiers whose authorizations are in the See https://www.rfc-editor.org/rfc/rfc8555#section-7.1.6 for state changes of authorizations. Returned: always |
|
A list of all identifiers whose authorizations are in the See https://www.rfc-editor.org/rfc/rfc8555#section-7.1.6 for state changes of authorizations. Returned: always |
|
A list of all identifiers whose authorizations are in the See https://www.rfc-editor.org/rfc/rfc8555#section-7.1.6 for state changes of authorizations. Returned: always |
|
A list of all identifiers whose authorizations are in the See https://www.rfc-editor.org/rfc/rfc8555#section-7.1.6 for state changes of authorizations. Returned: always |
|
A list of all identifiers whose authorizations are in the See https://www.rfc-editor.org/rfc/rfc8555#section-7.1.6 for state changes of authorizations. Returned: always |
|
A list of all identifiers whose authorizations are in the See https://www.rfc-editor.org/rfc/rfc8555#section-7.1.6 for state changes of authorizations. Returned: always |
|
The order object. See https://www.rfc-editor.org/rfc/rfc8555#section-7.1.3 for its specification. Returned: success |
|
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 The authorizations themselves are returned as Returned: always |
|
A URL for the certificate that has been issued in response to this order. Returned: when the certificate has been issued |
|
The error that occurred while processing the order, if any. This field is structured as a problem document according to RFC 7807. Returned: sometimes |
|
The timestamp after which the server will consider this order invalid. Encoded in the format specified in RFC 3339. Returned: if |
|
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 |
|
An array of identifier objects that the order pertains to. Returned: always |
|
The type of identifier. So far Returned: always Can only return:
Sample: |
|
The identifier itself. Returned: always Sample: |
|
The requested value of the Encoded in the date format defined in RFC 3339. Returned: depending on order |
|
The requested value of the Encoded in the date format defined in RFC 3339. Returned: depending on order |
|
If the ACME CA supports profiles through the draft-aaron-acme-profiles mechanism and informs about the profile selected for this order, this field will contain the name of the profile used. Returned: depending on the ACME CA |
|
If the order was created to replace an existing certificate using the Returned: when the certificate order is replacing a certificate through draft-ietf-acme-ari |
|
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:
|
|
ACME order URI. Returned: success |