cloudera.cloud.datalake_service lookup – Get the URL for a CDP Public Cloud Datalake 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.datalake_service
.
Synopsis
Allows you to retrieve the URL for a given CDP Public Cloud Datalake service.
If no service name (or optionally Knox service name) is found on the specified Datalake, the lookup returns the value of default.
Otherwise, the lookup entry will be an empty list.
If the Datalake 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.datalake_service', key1=value1, key2=value2, ...)
and query('cloudera.cloud.datalake_service', key1=value1, key2=value2, ...)
Parameter |
Comments |
---|---|
Name of the Datalake to query |
|
What return when the service name is not found on the Datahub Default: |
|
Name of the Environment of the Datalake to query |
|
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.datalake_service', term1, term2, key1=value1, key2=value2)
andquery('cloudera.cloud.datalake_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 Ranger Admin service, via Environment reference
ansible.builtin.debug:
msg: "{{ lookup('cloudera.cloud.datalake_service', 'RANGER_ADMIN', environment='example-env', wantlist=True) }}"
- name: Retrieve the details for the Ranger Admin service, via explicit Datalake reference
ansible.builtin.debug:
msg: "{{ lookup('cloudera.cloud.datalake_service', 'RANGER_ADMIN', datalake='example-dl', wantlist=True) }}"
- name: Return a generated list if the service does not exist
ansible.builtin.debug:
msg: "{{ query('cloudera.cloud.datalake_service', 'NO_SERVICE', environment='example-env', default=['something', 'else']) }}"
- name: Return multiple services from the same Datalake
ansible.builtin.debug:
msg: "{{ query('cloudera.cloud.datalake_service', 'RANGER_ADMIN', 'ATLAS_SERVER', 'CM-API', environment='example-env') }}"
- name: Return multiple services, specified as a list
ansible.builtin.debug:
msg: "{{ query('cloudera.cloud.datalake_service', ['RANGER_ADMIN', 'ATLAS_SERVER', 'CM-API'], environment='example-env') }}"
- name: Look up via Knox service
ansible.builtin.debug:
msg: "{{ query('cloudera.cloud.datalake_service', 'ATLAS_API', environment='example-env', knox_service=True) }}"
Return Value
Key |
Description |
---|---|
List of lists of service URLs Returned: success |