cloudera.cloud.env_user_sync module – Sync CDP Users and Groups to Environments

Note

This module is part of the cloudera.cloud collection (version 3.3.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.cloud.

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

New in cloudera.cloud 1.0.0

Synopsis

  • Synchronize users and groups with one or more CDP environments.

  • The module supports check_mode.

Parameters

Parameter

Comments

access_key

string

If provided, the Cloudera on cloud API will use this value as its access key.

If not provided, the API will attempt to use the value from the environment variable CDP_ACCESS_KEY_ID.

Required if private_key is provided.

Mutually exclusive with credentials_path.

credentials_path

string

If provided, the Cloudera on cloud API will use this value as its credentials path.

If not provided, the API will attempt to use the value from the environment variable CDP_CREDENTIALS_PATH.

Default: "~/.cdp/credentials"

current_user

aliases: user

boolean

Sync the current CDP user as defined by the CDP_PROFILE with all environments.

Mutually exclusive with name.

Choices:

  • false

  • true

debug

aliases: debug_endpoints

boolean

If true, the module will capture the Cloudera on cloud HTTP log and return it in the sdk_out and sdk_out_lines fields.

Choices:

  • false ← (default)

  • true

delay

aliases: polling_delay

integer

The internal polling interval (in seconds) while the module waits for the sync operation to complete.

Default: 15

endpoint

aliases: endpoint_url, url

string

The Cloudera on cloud API endpoint to use.

If not provided, the API will attempt to use the value from the environment variable CDP_ENDPOINT_URL.

Mutually exclusive with endpoint_region.

endpoint_region

aliases: cdp_endpoint_region, cdp_region, region

string

Specify the Cloudera on cloud API endpoint region.

See Cloudera Control Plane regions for more information.

If not provided, the API will attempt to use the value from the environment variable CDP_REGION.

default is an alias for the us-west-1 region.

Mutually exclusive with endpoint.

Choices:

  • "default"

  • "us-west-1" ← (default)

  • "eu-1"

  • "ap-1"

endpoint_tls

aliases: verify_endpoint_tls, verify_tls, verify_api_tls

boolean

Verify the TLS certificates for the Cloudera on cloud API endpoint.

Choices:

  • false

  • true ← (default)

http_agent

aliases: agent_header

string

The HTTP user agent to use for Cloudera on cloud API requests.

Default: "cloudera.cloud"

name

aliases: environment

list / elements=string

A single Environment or list of Environments that will sync all CDP Users and Groups.

If not present, all Environments will be synced.

Mutually exclusive with current_user.

private_key

string

If provided, the Cloudera on cloud API will use this value as its private key.

If not provided, the API will attempt to use the value from the environment variable CDP_PRIVATE_KEY.

Required if access_key is provided.

profile

string

If provided, the Cloudera on cloud API will use this value as its profile.

If not provided, the API will attempt to use the value from the environment variable CDP_PROFILE.

Default: "default"

strict

aliases: strict_errors

boolean

Legacy CDPy SDK error handling.

Choices:

  • false ← (default)

  • true

timeout

aliases: polling_timeout

integer

The internal polling timeout (in seconds) while the module waits for the sync operation to complete.

Default: 3600

wait

boolean

Flag to enable internal polling to wait for the user sync operation to complete.

Choices:

  • false

  • true ← (default)

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: N/A

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

# Note: These examples do not set authentication details.

# Sync a CDP Environment
- cloudera.cloud.env_user_sync:
    name: example-environment

# Sync multiple CDP Environments
- cloudera.cloud.env_user_sync:
    name:
      - example-environment
      - another-environment

# Sync the current CDP User
- cloudera.cloud.env_user_sync:
    current_user: true

Return Values

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

Key

Description

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

sync

complex

Returns an object describing of the status of the User and Group sync event.

Returned: success

endTime

string

Sync operation end timestamp (epoch seconds).

Returned: when supported

Sample: "1602080301000"

error

string

Error message for general failure of sync operation.

Returned: when supported

failure

list / elements=dictionary

List of sync operation details for all failed environments.

Returned: when supported

environmentCrn

string

The environment CRN.

Returned: always

message

string

Details on the failure.

Returned: when supported

operationId

string

UUID of the request for this operation.

Returned: always

Sample: "0e9bc67a-b308-4275-935c-b8c764dc13be"

operationType

string

The operation type.

Returned: when supported

Sample: "USER_SYNC"

startTime

string

Sync operation start timestamp (epoch seconds).

Returned: when supported

Sample: "1602080301000"

status

string

Status of this operation.

Returned: when supported

Sample: "['NEVER_RUN', 'REQUESTED', 'REJECTED', 'RUNNING', 'COMPLETED', 'FAILED', 'TIMEDOUT']"

success

list / elements=dictionary

List of sync operation details for all succeeded environments.

Returned: when supported

environmentCrn

string

The environment CRN.

Returned: always

message

string

Details on the success.

Returned: when supported

Authors

  • Webster Mudge (@wmudge)

  • Dan Chaffelson (@chaffelson)

  • Jim Enright (@jimright)