cloudera.cloud.datalake_instance lookup – Get the instances for a CDP Public Cloud Datalake

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_instance.

Synopsis

  • Allows you to retrieve the instances by one or more instance groups for a CDP Public Cloud Environment.

  • If the Environment or its Datalake is not found or is ambigious, the lookup will return an error.

  • If the instance group is not found, the lookup will return the default value.

Terms

Parameter

Comments

Terms

string / required

Instance group name

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_instance', key1=value1, key2=value2, ...) and query('cloudera.cloud.datalake_instance', key1=value1, key2=value2, ...)

Parameter

Comments

default

any

What return when the instance group is not found on the Datalake

Default: []

detailed

boolean

Whether to return the full entry for the matching Datalake instance group

Choices:

  • false ← (default)

  • true

environment

string / required

Name of the Environment to query

Notes

Note

  • When keyword and positional parameters are used together, positional parameters must be listed before keyword parameters: lookup('cloudera.cloud.datalake_instance', term1, term2, key1=value1, key2=value2) and query('cloudera.cloud.datalake_instance', term1, term2, key1=value1, key2=value2)

  • Requires cdpy.

See Also

See also

cloudera.cloud.env_info

Cloudera CDP Public Cloud Environment module

cloudera.cloud.datalake_info

Cloudera CDP Public Cloud Datalake module

Examples

- name: Retrieve the instances for the ID Broker instance group for a CDP Public Cloud environment
  ansible.builtin.debug:
    msg: "{{ query('cloudera.cloud.datalake_instance', 'idbroker', environment='example-env') }}"

- name: Retrieve the full details for the instance
  ansible.builtin.debug:
    msg: "{{ query('cloudera.cloud.datalake_instance', 'idbroker', environment='example-env', detailed=True) }}"

- name: Retrieve the instance details for multiple instance groups
  ansible.builtin.debug:
    msg: "{{ lookup('cloudera.cloud.datalake_instance', ['idbroker', 'master'], environment='example-env', wantlist=True) }}"

Return Value

Key

Description

Return value

list / elements=complex

List of lists of instances

Returned: success

Authors

  • Webster Mudge (@wmudge)

Hint

Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.