Horizon lookup plugin
Note
This lookup plugin is part of the evertrust.horizon collection (version 1.5.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_lookup
.
Synopsis
Retrieve certificate’s information from Horizon.
Keyword parameters
This describes keyword parameters of the lookup. These are the values key1=value1
, key2=value2
and so on in the following
examples: lookup('evertrust.horizon.horizon_lookup', key1=value1, key2=value2, ...)
and query('evertrust.horizon.horizon_lookup', key1=value1, key2=value2, ...)
Parameter |
Comments |
---|---|
Path of a CA bundle used to validate the Horizon instance SSL certificate. |
|
A certificate in PEM format, or the path to the certificate PEM file. |
|
The path to a certificate PEM file |
|
Path of a client certificate. Required if you use certificate based authentication |
|
Path of a client certificate’s key. Required if you use certificate based authentication |
|
Your Horizon instance base endpoint. It must include the protocol (https://) and no trailing slash nor path. |
|
Fields to be retrieved from Horizon. If omitted, all fields will be returned. Choices:
|
|
Horizon identifier Required if you use credentials authentication |
|
Horizon password Required if you use credentials authentication |
Examples
vars:
endpoint: "https://<horizon-endpoint>"
x_api_id: "<horizon-id>"
x_api_key: "<horizon-password>"
# Send the certificate by specifying its content (string)
my_pem: <a_webra_pem_file>
# Send the certificate by specifying its file path
pem_path:
src: /pem/file/path
# Sets a variable containing only one field (module)
with_one: "{{ lookup('evertrust.horizon.horizon_lookup', x_api_id=x_api_id, x_api_key=x_api_key, certificate_pem=my_pem, fields='module', endpoint=horizon_endpoint, wantlist=True) }}"
# Sets a variable containing a list of fields (module, _id)
with_list: "{{ lookup('evertrust.horizon.horizon_lookup', x_api_id=x_api_id, x_api_key=x_api_key, certificate_pem=my_pem, fields=['module', '_id'], endpoint=horizon_endpoint, wantlist=True) }}"
# Sets a variable containing every certificate field.
without: "{{ lookup('evertrust.horizon.horizon_lookup', x_api_id=x_api_id, x_api_key=x_api_key, certificate_pem=pem_path, endpoint=horizon_endpoint, wantlist=True) }}"
Return Value
Key |
Description |
---|---|
Horizon internal certificate ID. Returned: If specifically requested. |
|
Certificate in PEM format. Returned: If specifically requested. |
|
True if the revocation status was reconciled from the CRL Returned: If present and specifically requested. |
|
True if the certificate was discovered and trusted. False if the certificate was discovered. Absent if the certificate was not discovered. Returned: If present and specifically requested. |
|
Certificate discovery data. Returned: Only if the certificate was discovered. |
|
Host hostnames. Returned: If present. |
|
Host IP address Returned: Always. |
|
Host operating systems Returned: If present. |
|
Host paths. Returned: If present. |
|
Host TLS ports. Returned: If present. |
|
Port number. Returned: Always. |
|
TLS version. Returned: Always. |
|
Certificate usages. Returned: If present. |
|
Certificate’s discovery info Returned: If present and specifically requested |
|
Campaign name. Returned: Always. |
|
Horizon user that discovered the certificate. Returned: If present. |
|
Last discovery date (UNIX timestamp in millis). Returned: Always. |
|
Certificate DN. Returned: If specifically requested. |
|
Certificate holder ID. Returned: If specifically requested. |
|
Certificate issuer DN. Returned: If specifically requested. |
|
Certificate key type. Returned: If specifically requested. |
|
Certificate labels. Returned: If present and specifically requested. |
|
Label key Returned: Always. |
|
Label value Returned: Always. |
|
Certificate metadata. Returned: If specifically requested. |
|
Metadata key Returned: Always. |
|
Metadata value Returned: Always. |
|
Certificate module. Returned: If specifically requested. |
|
Certificate expiration date (UNIX timestamp in millis). Returned: If specifically requested. |
|
Certificate issuance date (UNIX timestamp in millis). Returned: If specifically requested. |
|
Certificate’s owner. Returned: If specifically requested. |
|
Certificate profile. Returned: If present and specifically requested. |
|
Certificate public key thumbprint. Returned: If specifically requested. |
|
Certificate revocation date (UNIX timestamp in millis). Returned: If present and specifically requested. |
|
Certificate revocation reason. Returned: If specifically requested. |
|
True if the certificate is self-signed. Returned: If specifically requested. |
|
Certificate serial number (hexadecimal format). Returned: If specifically requested. |
|
Certificate signing algorithm. Returned: If specifically requested. |
|
Certificate subject alternate names (SANs). Returned: If specifically requested. |
|
SAN type Returned: Always |
|
SAN value Returned: Always |
|
Certificate third-party data. Returned: If present and specifically requested. |
|
Third party connector name. Returned: Always. |
|
Third party object fingerprint. Returned: If present. |
|
Third party object ID. Returned: Always. |
|
Certificate’s push date in the third party (UNIX timestamp in millis). Returned: If present. |
|
Certificate’s remove date in the third party (UNIX timestamp in millis). Returned: If present. |
|
Certificate public key thumbprint. Returned: If specifically requested. |
|
Certificate trigger results. Returned: If present and specifically requested. |
|
Execution details. Returned: If present. |
|
Trigger event type. Returned: Always. |
|
Last trigger execution date (UNIX timestamp in millis). Returned: Always. |
|
Trigger name. Returned: Always. |
|
Duration until next try. Returned: If present. |
|
Next trigger execution date (UNIX timestamp in millis). Returned: If present. |
|
Trigger retries count. Returned: If present. |
|
Trigger type. Returned: Always. |