cloudera.cloud.datahub_template lookup – Get a Datahub template for a CDP Public Cloud Environment

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

Synopsis

  • Allows you to retrieve the Datahub templates matching the Datalake CDH Runtime for one or more CDP Public Cloud Environments.

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

Terms

Parameter

Comments

Terms

string / required

A CDP Public Cloud Environment 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.datahub_template', key1=value1, key2=value2, ...) and query('cloudera.cloud.datahub_template', key1=value1, key2=value2, ...)

Parameter

Comments

detailed

boolean

Whether to return the full entry for the matching Datahub templates

Choices:

  • false ← (default)

  • true

status

string

Category of the Datahub templates to filter

Choices:

  • "USER_MANAGED"

  • "DEFAULT"

template

string

Name (substring) of the Datahub template to filter the resulting matches

Notes

Note

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

  • Requires cdpy.

  • If you encounter worker found in a dead state and are running OSX, set the environment variable, OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES.

See Also

See also

cloudera.cloud.datahub_template_info

Cloudera CDP Public Cloud Datahub template module

Examples

- name: Retrieve the Datahub templates for a single CDP Public Cloud Environment
  ansible.builtin.debug:
    msg: "{{ query('cloudera.cloud.datahub_template', 'example-env') }}"

- name: Retrieve the Datahub templates that match the given substring
  ansible.builtin.debug:
    msg: "{{ query('cloudera.cloud.datahub_template', 'example-env', template='Flow Management Light Duty') }}"

- name: Retrieve the only user-managed Datahub templates
  ansible.builtin.debug:
    msg: "{{ query('cloudera.cloud.datahub_template', 'example-env', status='USER_MANAGED') }}"

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

- name: Retrieve the Datahub template details for multiple CDP Public Cloud Environments
  ansible.builtin.debug:
    msg: "{{ lookup('cloudera.cloud.datahub_template', ['example-env', 'another-env'], wantlist=True) }}"

Return Value

Key

Description

Return value

list / elements=complex

List of lists of Datahub templates

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.