cloudera.cluster.host module – Manage hosts within Cloudera Manager

Note

This module is part of the cloudera.cluster collection (version 4.4.0).

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

Synopsis

  • Allows for the management of hosts within the Cloudera Manager.

  • It provides functionalities to create, delete, attach, or detach host instance from a cluster.

Requirements

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

  • cm_client

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_hostname

string / required

The name of the host.

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.

host_ip

aliases: cluster_host_ip

string

The ip of the host.

name

string

The name of the CM Cluster.

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.

rack_id

string

The rack ID for this host.

ssl_ca_cert

aliases: tls_cert, ssl_cert

path

Path to SSL CA certificate to use for validation.

state

string

State of the host.

Choices:

  • "present" ← (default)

  • "absent"

  • "attached"

  • "detached"

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

diff_mode

Support: none

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

platform

Platforms: all

Target OS/families that can be operated against

Examples

---
- name: Create a host
  cloudera.cluster.host:
    host: "example.cloudera.host"
    username: "will_jordan"
    password: "S&peR4Ec*re"
    rack_id: "/default"
    cluster_hostname: "Ecs_node_01"
    host_ip: "10.9.8.7"
    state: "present"

- name: Attach a host to the Cluster
  cloudera.cluster.host:
    host: "example.cloudera.host"
    username: "will_jordan"
    name: "Base_Edge2AI_Node"
    password: "S&peR4Ec*re"
    cluster_hostname: "Ecs_node_01"
    state: "attached"

- name: Detach a host to the Cluster
  cloudera.cluster.host:
    host: "example.cloudera.host"
    username: "will_jordan"
    name: "Base_Edge2AI_Node"
    password: "S&peR4Ec*re"
    cluster_hostname: "Ecs_node_01"
    state: "detached"

- name: Remove a host
  cloudera.cluster.host:
    host: "example.cloudera.host"
    username: "will_jordan"
    password: "S&peR4Ec*re"
    cluster_hostname: "Ecs_node_01"
    state: "absent"

Return Values

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

Key

Description

cloudera_manager

dictionary

Details about Cloudera Manager Host

Returned: success

clusterRef

string

A reference to the enclosing cluster.

Returned: optional

commissionState

string

Represents the Commission state of an entity.

Returned: optional

distribution

dictionary

OS distribution details.

Returned: optional

entity_status

string

The single value used by the Cloudera Manager UI to represent the status of the entity.

Returned: optional

health_checks

list / elements=string

Represents a result from a health test performed by Cloudera Manager for an entity.

Returned: optional

health_summary

string

The summary status of health check.

Returned: optional

host_id

string

A unique host identifier. This is not the same as the hostname (FQDN). It is a distinct value that remains the same even if the hostname changes.

Returned: optional

host_url

string

A URL into the Cloudera Manager web UI for this specific host.

Returned: optional

hostname

string

The hostname. This field is not mutable after the initial creation.

Returned: optional

ip_address

string

The host IP address. This field is not mutable after the initial creation.

Returned: optional

last_heartbeat

string

Time when the host agent sent the last heartbeat.

Returned: optional

maintenance_mode

boolean

Maintance mode of Cloudera Manager Service.

Returned: optional

maintenance_owners

list / elements=string

List of Maintance owners for Cloudera Manager Service.

Returned: optional

num_cores

integer

The number of logical CPU cores on this host.

Returned: optional

numPhysicalCores

integer

The number of physical CPU cores on this host.

Returned: optional

rack_id

string

The rack ID for this host.

Returned: optional

role_refs

list / elements=string

The list of roles assigned to this host.

Returned: optional

tags

list / elements=string

Tags associated with the host.

Returned: optional

total_phys_mem_bytes

string

he amount of physical RAM on this host, in bytes.

Returned: optional


Authors

  • Ronald Suplina (@rsuplina)

Collection links