cloudera.cloud.datahub_service lookup – Get the URL for a CDP Public Cloud Datahub service
Note
This lookup plugin is part of the cloudera.cloud collection (version 2.5.1).
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 cloudera.cloud
.
To use it in a playbook, specify: cloudera.cloud.datahub_service
.
Synopsis
Allows you to retrieve the URL for a given CDP Public Cloud Datahub service.
If no service name (or optionally Knox service name) is found on the specified Datahub, the lookup returns the value of default.
Otherwise, the lookup entry will be an empty list.
If the Datahub is not found or is ambigious, the lookup will return an error.
Terms
Parameter |
Comments |
---|---|
An endpoint If knox_service=True, then these values will lookup against the endpoint For example, |
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('cloudera.cloud.datahub_service', key1=value1, key2=value2, ...)
and query('cloudera.cloud.datahub_service', key1=value1, key2=value2, ...)
Parameter |
Comments |
---|---|
Name of the Datahub to query |
|
What return when the service name is not found on the Datahub Default: |
|
Whether the terms are Choices:
|
Notes
Note
When keyword and positional parameters are used together, positional parameters must be listed before keyword parameters:
lookup('cloudera.cloud.datahub_service', term1, term2, key1=value1, key2=value2)
andquery('cloudera.cloud.datahub_service', term1, term2, key1=value1, key2=value2)
You can pass the
Undefined
object asdefault
to force an undefined error.Requires
cdpy
.
Examples
- name: Retrieve the details for the NiFi Registry REST service API
ansible.builtin.debug:
msg: "{{ lookup('cloudera.cloud.datahub_service', 'NIFI_REGISTRY_SERVER', datahub='example-datahub', wantlist=True) }}"
- name: Return a generated list if the service does not exist
ansible.builtin.debug:
msg: "{{ query('cloudera.cloud.datahub_service', 'STREAMS_MESSAGING_MANAGER_SERVER', datahub='non-smm-datahub', default=['something']) }}"
- name: Return multiple services from the same Datahub
ansible.builtin.debug:
msg: "{{ query('cloudera.cloud.datahub_service', 'STREAMS_MESSAGING_MANAGER_SERVER', 'CM-API', datahub='example-datahub') }}"
- name: Return multiple services, specified as a list
ansible.builtin.debug:
msg: "{{ query('cloudera.cloud.datahub_service', ['STREAMS_MESSAGING_MANAGER_SERVER', 'CM-API'], datahub='example-datahub') }}"
- name: Look up via Knox service
ansible.builtin.debug:
msg: "{{ query('cloudera.cloud.datahub_service', 'NIFI_REST', datahub='example-datahub', knox_service=True) }}"
Return Value
Key |
Description |
---|---|
List of lists of service URLs Returned: success |