Horizon inventory plugin
Note
This inventory 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_inventory
.
Synopsis
Generate hosts inventory from Horizon using an HCQL query.
Use a YAML configuration file that ends with
horizon_inventory.(yml|yaml
).
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 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:
|
|
A list in order of precedence for hostname variables. To use labels as hostnames use the syntax label.<key>. Default: |
|
HCQL query to filter the results. |
|
Horizon identifier Required if you use credentials authentication |
|
Horizon password Required if you use credentials authentication |
Examples
plugin: evertrust.horizon.horizon_inventory
endpoint: "https://<horizon-endpoint>"
x_api_id: "<horizon-id>"
x_api_key: "<horizon-password>"
query: "status is valid"
fields:
- labels
- module
- subjectAlternateNames
# Possible values: san.ip, san.dns, discoveryData.ip, discoveryData.Hostname, label.<key>
# To use your host IPs as inventory hostnames, the correct syntax would be label.ansible_host
hostnames:
- label.ansible_host
- san.dns