Horizon certificate retrieval module
Note
This module is part of the evertrust.horizon collection (version 2.0.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 evertrust.horizon.
To use it in a playbook, specify: evertrust.horizon.horizon_get_certificate.
Synopsis
Wait for and retrieve a certificate from an enrollment request.
Polling stops when the certificate is available, the timeout expires, or the request reaches a terminal status without a certificate.
Note
This module has a corresponding action plugin.
Parameters
Parameter |
Comments |
|---|---|
Path of a CA bundle used to validate the Horizon instance SSL certificate. |
|
Path of a client certificate. Required if you use certificate based authentication |
|
Path to the private key used for client-certificate authentication. Required if you use certificate based authentication. Restrict access to the key and inventory configuration files. |
|
Maximum number of seconds to wait for the controller to establish a connection to Horizon. Default: |
|
Your Horizon instance base endpoint. It must include the protocol (https://) and no trailing slash nor path. |
|
Time between request-status checks, in seconds. Must be greater than zero. Default: |
|
Maximum number of seconds to wait between response reads by the controller after connecting to Horizon. Default: |
|
Request ID returned by evertrust.horizon.horizon_request_enroll. |
|
Maximum total waiting time, in seconds. Set to zero to wait indefinitely. This is separate from the per-request Default: |
|
Horizon identifier Required if you use credentials authentication |
|
Secret API key used for Horizon credential authentication. Required if you use credentials authentication. Store this value with Ansible Vault. Tasks containing lookup expressions with this value should use |
Notes
Note
The module fails when the request is denied, canceled, or fails.
A timeout value of
0waits indefinitely.
Examples
- name: Wait up to five minutes for certificate issuance
evertrust.horizon.horizon_get_certificate:
request_id: "{{ enrollment_request.request_id }}"
timeout: 300
poll_interval: 5
register: enrollment_result
- name: Wait for the approved certificate indefinitely
evertrust.horizon.horizon_get_certificate:
request_id: "{{ enrollment_request.request_id }}"
timeout: 0
poll_interval: 10
register: enrollment_result
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
The certificate that was generated for this request. This is only available after the request has been approved. Returned: On successful certificate issuance |
|
Horizon internal ID. Returned: If present |
|
The certificate’s PEM-encoded content. Returned: If present |
|
The certificate’s contact email. It will be used to send notifications about the certificate’s expiration and revocation. Returned: If present |
|
Whether the certificate’s revocation status is synchronized with a CRL. Returned: If present |
|
True if the certificate was discovered and issued by an existing trusted CA. False if the certificate was discovered but not issued by a trusted CA. Null if the certificate was not discovered. Returned: If present |
|
A list of metadata containing information on where the certificate was discovered. Returned: Only if the certificate was discovered |
|
The certificate’s hostnames (netscan only). Returned: If present |
|
The certificate’s host IP address. Returned: Always |
|
The certificate’s host operating system (localscan only). Returned: If present |
|
The path to the certificate on the host machine (localscan only). Returned: If present |
|
Information on the type of discovery that discovered this certificate. Returned: Always |
|
The ports on which the certificate is exposed for HTTPS connection. Returned: If present |
|
The number of the port. Returned: Always |
|
Protocol version used. Returned: Always |
|
The path of the configuration files that were used to find the certificates. Returned: If present |
|
A list of metadata containing information on how and when the certificate was discovered. Returned: If present |
|
The discovery campaign’s name. Returned: Always |
|
Identifier of the user that discovered this certificate. Returned: If present |
|
When this certificate was discovered for the last time. Returned: Always |
|
The certificate’s Distinguished Name. Returned: If present |
|
The certificate’s extensions. Returned: If present |
|
The extension’s type. Returned: Always |
|
The extension’s value. Returned: Always |
|
The certificate’s grades for the enabled grading policies. Returned: If present |
|
The grade awarded by the grading policy. Returned: Always |
|
The name of the grading policy. Returned: Always |
|
The certificate’s computed holder ID. It counts similar certificates used simultaneously by the same holder. Returned: If present |
|
The certificate’s issuer Distinguished Name. Returned: If present |
|
The certificate’s key type. Returned: If present |
|
The certificate’s labels. Returned: If present |
|
The label’s name. Returned: Always |
|
The label’s value. Returned: Always |
|
The certificate’s technical metadata used internally. Returned: If present |
|
The metadata name. Returned: Always |
|
The metadata value. Returned: Always |
|
The certificate’s module. Returned: If present |
|
The certificate’s expiration date in milliseconds since the epoch. Returned: If present |
|
The certificate’s start date in milliseconds since the epoch. Returned: If present |
|
The certificate’s owner. This is a reference to a local identity identifier. Returned: If present |
|
The certificate’s profile. Returned: If present |
|
The certificate’s public key thumbprint. Returned: If present |
|
The certificate’s revocation date in milliseconds since the epoch. This field is only present if the certificate is revoked. Returned: If present |
|
The certificate’s revocation reason. Returned: If present |
|
Whether the certificate is revoked. Returned: If present |
|
Whether the certificate is self-signed. Returned: If present |
|
The certificate’s serial number. Returned: If present |
|
The certificate’s signing algorithm. Returned: If present |
|
The certificate’s Subject Alternate Names. Returned: If present |
|
The type of the SAN. Returned: Always |
|
The value of the SAN. Returned: Always |
|
The certificate’s team, as a reference to a team identifier. It determines certificate permissions and notification recipients. Returned: If present |
|
The certificate’s information about synchronization with Horizon supported third parties. Returned: If present |
|
The third party connector name on which this certificate is synchronized. Returned: Always |
|
The fingerprint of this certificate on the third party. Returned: If present |
|
The ID of this certificate on the third party. Returned: Always |
|
The date when the certificate was pushed to this third party. Returned: If present |
|
The date when the certificate was removed from this third party (in case of revocation). Returned: If present |
|
The certificate’s thumbprint. Returned: If present |
|
The result of the execution of triggers on this certificate. Returned: If present |
|
Contains details on this trigger’s execution. Returned: If present |
|
The event that triggered the trigger. Returned: Always |
|
The last time this trigger was executed for this certificate and this event. Returned: Always |
|
The name of the trigger that was executed. Returned: Always |
|
Time that will be waited between the two successive executions of this trigger. Returned: If present |
|
The next scheduled execution time for this trigger. Returned: If present |
|
The number of remaining tries before the trigger is abandoned. Returned: If present |
|
Is this trigger manually retryable. Returned: Always |
|
The status of the trigger after its execution. Returned: Always |
|
The type of the trigger. Returned: Always |
|
Certificate trust chain. Returned: On successful certificate issuance |
|
Base64-encoded PKCS#12 archive returned for a centralized enrollment. Returned: When the completed centralized enrollment includes a PKCS#12 archive |
|
Password protecting the returned PKCS#12 archive. Returned: When the PKCS#12 archive is returned |
|
ID of the enrollment request. Returned: Always |
|
Last enrollment request status observed before the module returns. Depending on the Horizon version, intermediate statuses can include Terminal statuses without a certificate include Returned: Always |