cloudera.cloud.recipe module – Manage a CDP recipe

Note

This module 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. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: cloudera.cloud.recipe.

Synopsis

  • Create, update, and delete a CDP recipe.

  • A recipe is a script that runs on nodes of Data Hub, Datalake, or FreeIPA nodes.

  • See the Cloudera documentation on recipes for details.

Requirements

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

  • cdpy

Parameters

Parameter

Comments

cdp_region

aliases: cdp_endpoint_region, endpoint_region

string

Specify the Cloudera Data Platform endpoint region.

Default: "default"

content

aliases: recipe_content

string

The content of the recipe.

Required if state=present.

debug

aliases: debug_endpoints

boolean

Capture the CDP SDK debug log.

Choices:

  • false ← (default)

  • true

description

aliases: desc

string

The description of the recipe.

name

aliases: recipe, recipe_name

string / required

The name of the recipe.

profile

string

If provided, the CDP SDK will use this value as its profile.

state

string

State of the recipe.

Choices:

  • "present" ← (default)

  • "absent"

type

string

Execution hook for the recipe.

Required if state=present.

Choices:

  • "POST_CLOUDERA_MANAGER_START"

  • "PRE_TERMINATION"

  • "PRE_SERVICE_DEPLOYMENT"

  • "POST_SERVICE_DEPLOYMENT"

verify_endpoint_tls

aliases: endpoint_tls

boolean

Verify the TLS certificates for the CDP endpoint.

Choices:

  • false

  • true ← (default)

Notes

Note

  • This module supports check_mode.

  • If the existing recipe is different than the declared state, the recipe is recreated and assigned a new CRN.

Examples

# Note: These examples do not set authentication details.

- name: Create a recipe
  cloudera.cloud.recipe:
    name: example-recipe
    type: PRE_TERMINATION
    content: |
      #!/bin/bash
      echo "Done"

- name: Delete a recipe
  cloudera.cloud.recipe:
    name: example-recipe
    state: absent

Return Values

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

Key

Description

recipe

dictionary

The information about the recipe.

Returned: always

creatorCrn

string

The CRN of the creator of the recipe.

Returned: when supported

crn

string

The CRN of the recipe.

Returned: always

description

string

The description of the recipe.

Returned: when supported

recipeContent

string

The content of the recipe.

Returned: when supported

recipeName

string

The name of the recipe.

Returned: always

type

string

The type of recipe.

Supported values are: POST_CLOUDERA_MANAGER_START, PRE_TERMINATION, PRE_SERVICE_DEPLOYMENT, POST_SERVICE_DEPLOYMENT.

Returned: when supported

sdk_out

string

Returns the captured CDP SDK log.

Returned: when supported

sdk_out_lines

list / elements=string

Returns a list of each line of the captured CDP SDK log.

Returned: when supported

Authors

  • Webster Mudge (@wmudge)