cloudera.cluster.data_context module – Create, update, or delete a data context

Note

This module is part of the cloudera.cluster collection (version 5.0.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 cloudera.cluster. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: cloudera.cluster.data_context.

New in cloudera.cluster 5.0.0

Synopsis

  • Configure details of a specific data context.

  • Create a new data context.

  • Update an existing data context.

  • Delete a data context.

  • The module supports check_mode.

Requirements

The below requirements are needed on the host that executes this module.

  • cm-client >= 54

Parameters

Parameter

Comments

agent_header

aliases: user_agent

string

Set the HTTP user agent header when interacting with the CM API endpoint.

Default: "ClouderaFoundry"

cluster

aliases: cluster_name

string

The name of the Cloudera Manager cluster.

debug

aliases: debug_endpoints

boolean

Capture the HTTP interaction logs with the CM API endpoint.

Choices:

  • false ← (default)

  • true

force_tls

boolean

Flag to force TLS during CM API endpoint discovery.

If False, discovery will first try HTTP and follow any redirects.

Choices:

  • false ← (default)

  • true

host

aliases: hostname

string

Hostname of the CM API endpoint.

If set, the host parameter will trigger CM API endpoint discovery, which will follow redirects.

Mutually exclusive with url.

name

aliases: context_name, data_context_name

string / required

The name of the data context.

password

string / required

Password for access to the CM API endpoint.

This parameter is set to no_log.

port

integer

Port of the CM API endpoint.

If set, CM API endpoint discovery will connect to the designated port first and will follow redirects.

Default: 7180

proxy_server

aliases: proxy, http_proxy

string

Set the HTTP/S proxy server when interacting with the CM API endpoint.

services

list / elements=string

A list of services that the data context will include.

ssl_ca_cert

aliases: tls_cert, ssl_cert

path

Path to SSL CA certificate to use for validation.

state

string

If state=present, the data context will be created or updated.

If state=absent, the data context will be deleted

Choices:

  • "present" ← (default)

  • "absent"

url

aliases: endpoint, cm_endpoint_url

string

The CM API endpoint URL and should include scheme, host, port, and API root path.

Mutually exclusive with host.

username

aliases: user

string / required

Username for access to the CM API endpoint.

verify_tls

boolean

Verify the TLS certificates for the CM API endpoint.

Choices:

  • false

  • true ← (default)

version

aliases: api_version

string

API version of the CM API endpoint.

Default: "True"

Attributes

Attribute

Support

Description

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying target, if not supported the action will be skipped.

diff_mode

Support: full

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode

platform

Platforms: 

Target OS/families that can be operated against

Examples

- name: Create a Data Context
  cloudera.cluster.data_context:
    host: example.cloudera.com
    username: "jane_smith"
    password: "S&peR4Ec*re"
    name: "base_services"
    cluster: "example_cluster"
    services: ['hive', 'atlas', 'hdfs', 'ranger']
    state: present

- name: Delete a data context
  cloudera.cluster.data_context:
    host: example.cloudera.com
    username: "jane_smith"
    password: "S&peR4Ec*re"
    name: "base_services"
    state: absent

- name: Update an existing data context
  cloudera.cluster.data_context:
    host: example.cloudera.com
    username: "jane_smith"
    password: "S&peR4Ec*re"
    name: "base_services"
    cluster: "example_cluster"
    services: ['hive', 'atlas', 'hdfs']
    state: present

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

data_context

dictionary

A dictionary containing details of data contexts within the cluster.

Returned: always

allowed_cluster_versions

list / elements=string

The list of allowed cluster versions within data context.

Returned: always

client_config_staleness_status

string

Status of the client configuration within data context.

Returned: always

config_staleness_status

string

Status of the configuration within data context.

Returned: always

created_time

string

The timestamp indicating when the data context was created.

Returned: always

display_name

string

The display name of the data context.

Returned: always

health_summary

string

The health status of the data context.

Returned: always

last_modified_time

string

The timestamp indicating the last modification of the data context.

Returned: always

name

string

The name of the data context.

Returned: always

nameservice

string

The name service that data context belongs to.

Returned: always

services

list / elements=string

The list of services associated with data context.

Returned: always

supported_service_types

list / elements=string

The list of supported services types within data context.

Returned: always

Authors

  • Ronald Suplina (@rsuplina)