cloudera.cloud.env module – Manage CDP Environments
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.env
.
Synopsis
Create, update, and delete CDP Environments
Note that changing states, in particular, creating a new environment, can take several minutes.
Requirements
The below requirements are needed on the host that executes this module.
cdpy
Parameters
Parameter |
Comments |
---|---|
The base location to store backups. This should be an storage uri - i.e. s3a:// for AWS, abfs:// for Azure, gs:// for GCP. |
|
Flag to delete all connected resources, e.g. Data Services and Data Hubs. Choices:
|
|
Specify the Cloudera Data Platform endpoint region. Default: |
|
The cloud provider or platform for the environment. Requires region, credential, log_location, and log_identity. If cloud=aws, one of public_key or public_key_id must be present. If cloud=aws, one of network_cidr or vpc_id must be present. If cloud=aws, one of inbound_cidr or default_sg and knox_sg must be present. Choices:
|
|
The CDP credential associated with the environment |
|
Also starts datahubs within this environment when starting the environment Choices:
|
|
Capture the CDP SDK debug log. Choices:
|
|
Security group where all other hosts are placed. Mutually exclusive with inbound_cidr. |
|
The internal polling interval (in seconds) while the module waits for the environment to achieve the declared state. Default: |
|
A description for the environment. |
|
(AWS)The scheme for the workload endpoint gateway. PUBLIC creates an external endpoint that can be accessed over the Internet. Defaults to PRIVATE which restricts the traffic to be internal to the VPC / Vnet. Relevant in Private Networks. Choices:
|
|
(AWS) The list of subnet IDs to use for endpoint access gateway. |
|
Flag to remove CDP and cloud provider resources, but ignore cloud provider resources deletion errors. NOTE, this option might leave cloud provider resources after deletion. Choices:
|
|
The FreeIPA service for the environment. |
|
The number of FreeIPA instances to create per group when creating FreeIPA in the environment. For high-availability, provide a number greater than 2. Default: |
|
Flag to specify that the FreeIPA instances will be deployed across multi-availability zones. Only applies to AWS environments. Choices:
|
|
CIDR range which is allowed for inbound traffic. Either IPv4 or IPv6 is allowed. Mutually exclusive with default_sg and knox_sg. |
|
Security group where Knox-enabled hosts are placed. Mutually exclusive with inbound_cidr. |
|
(AWS) The instance profile ARN assigned the necessary permissions to access the S3 storage location, i.e. log_location. |
|
(AWS) The base location to store logs in S3. This should be an s3a:// url. |
|
The name of the target environment. Names must begin with a lowercase alphanumeric, contain only lowercase alphanumerics and hyphens, and be between 5 to 28 characters in length. |
|
(AWS) The network CIDR. This will create a VPC along with subnets in multiple Availability Zones. Mutually exclusive with vpc_id and subnet_ids. |
|
If provided, the CDP SDK will use this value as its profile. |
|
Name of Project when deploying environment on GCP |
|
The name of the proxy config to use for the environment. |
|
The public SSH key ID already registered in the cloud provider. Mutually exclusive with public_key_text. |
|
The content of a public SSH key. Mutually exclusive with public_key_id. |
|
The cloud platform specified region |
|
The declarative state of the environment If state=present, one of cloud or credential must be present. Choices:
|
|
(AWS) One or more subnet identifiers within the VPC. Mutually exclusive with network_cidr and requires vpc_id. |
|
Tags associated with the environment and its resources. |
|
The internal polling timeout (in seconds) while the module waits for the environment to achieve the declared state. Default: |
|
Flag to enable SSH tunnelling for the environment. Choices:
|
|
Verify the TLS certificates for the CDP endpoint. Choices:
|
|
(AWS) The VPC ID. Mutually exclusive with network_cidr and requires subnet_ids. |
|
Flag to enable internal polling to wait for the environment to achieve the declared state. If set to FALSE, the module will return immediately. Choices:
|
|
Flag to enable diagnostic information about job and query execution to be sent to Workload Manager for Data Hub clusters created within the environment. Choices:
|
|
(GCP) The list of zones within the region to use for compute instances. |
Examples
# Note: These examples do not set authentication details.
# Create an environment
- cloudera.cloud.env:
name: example-environment
state: present
credential: example-credential
cloud: aws
region: us-east-1
log_location: s3a://example-bucket/datalake/logs
log_identity: arn:aws:iam::123456789123:instance-profile/example-log-role
backup_location: s3a://example-bucket/datalake/backups
public_key_id: example-sshkey
network_cidr: 10.10.0.0/16
inbound_cidr: 0.0.0.0/0
tags:
project: Arbitrary content
# Create an environment with multiAz FreeIPA, but don't wait for completion (see env_info)
- cloudera.cloud.env:
name: example-environment
state: present
wait: no
credential: example-credential
cloud: aws
region: us-east-1
log_location: s3a://example-bucket/datalake/logs
log_identity: arn:aws:iam::123456789123:instance-profile/example-log-role
public_key_id: example-sshkey
network_cidr: 10.10.0.0/16
inbound_cidr: 0.0.0.0/0
freeipa:
instanceCountByGroup: 3
multiAz: yes
tags:
project: Arbitrary content
# Update the environment's CDP credential
- cloudera.cloud.env:
name: example-module
credential: another-credential
# Stop the environment (and wait for status change)
- cloudera.cloud.env:
name: example-module
state: stopped
# Start the environment (and wait for status change)
- cloudera.cloud.env:
name: example-module
state: started
# Delete the environment (and wait for status change)
cloudera.cloud.env:
name: example-module
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The information about the Environment Returned: on success |
|
Additional SSH key authentication configuration for accessing cluster node instances of the Environment. Returned: always |
|
SSH user name created on the node instances for SSH access. Returned: always Sample: |
|
SSH Public key string Returned: when supported Sample: |
|
Public SSH key ID registered in the cloud provider. Returned: when supported Sample: |
|
Cloud provider of the Environment. Returned: always Sample: |
|
Name of the CDP Credential of the Environment. Returned: always Sample: |
|
CDP CRN value for the Environment. Returned: always Sample: |
|
Description of the Environment. Returned: always Sample: |
|
Name of the Environment. Returned: always Sample: |
|
Details of a FreeIPA instance in the Environment. Returned: always |
|
CRN of the FreeIPA instance. Returned: always Sample: |
|
Domain name of the FreeIPA instance. Returned: always Sample: |
|
Hostname of the FreeIPA instance. Returned: always Sample: |
|
IP addresses of the FreeIPA instance. Returned: always Sample: |
|
Storage configuration for cluster and audit logs for the Environment. Returned: always |
|
AWS-specific log storage configuration details. Returned: when supported |
|
AWS instance profile that contains the necessary permissions to access the S3 storage location. Returned: always Sample: |
|
Base location to store logs in S3. Returned: always Sample: |
|
Azure-specific log storage configuration details. Returned: when supported |
|
Azure managing identity associated with the logger. This identify should have the Storage Blob Data Contributor role on the given storage account. Returned: always Sample: |
|
Base location to store logs in Azure Blob Storage. Returned: always Sample: |
|
Flag for external log storage. Returned: always |
|
Network details for the Environment Returned: always |
|
AWS networking specifics for the Environment. Returned: when supported |
|
VPC identifier. Returned: always Sample: |
|
Azure networking specifics for the Environment. Returned: when supported |
|
VNet identifier. Returned: always Sample: |
|
Resource Group name. Returned: always Sample: |
|
Flag for associating public IP addresses to the resources within the network. Returned: always |
|
Range of private IPv4 addresses that resources will use for the Environment. Returned: always Sample: |
|
Subnet identifiers for the Environment. Returned: always Sample: |
|
Additional subnet metadata for the Environment. Returned: always |
|
Keyed subnet identifier. Returned: always |
|
Availability zone (AWS only) Returned: when supported Sample: |
|
Identifier for the subnet Returned: always Sample: |
|
Name of the subnet Returned: always Sample: |
|
Proxy configuration of the Environment. Returned: when supported |
|
CDP CRN for the proxy configuration. Returned: always Sample: |
|
Description of the proxy. Returned: always Sample: |
|
Proxy host. Returned: always Sample: |
|
Proxy user password. Returned: always Sample: |
|
Proxy port. Returned: always Sample: |
|
Proxy protocol. Returned: always Sample: |
|
Name of the proxy configuration. Returned: always Sample: |
|
Proxy user name. Returned: always Sample: |
|
Cloud provider region of the Environment. Returned: always Sample: |
|
Security control configuration for FreeIPA and Datalake deployment in the Environment. Returned: always |
|
CIDR range which is allowed for inbound traffic. Either IPv4 or IPv6 is allowed. Returned: when supported Sample: |
|
Security group associated with Knox-enabled hosts. Returned: when supported Sample: |
|
Security group associated with all other hosts (non-Knox). Returned: when supported Sample: |
|
Status of the Environment. Returned: always Sample: |
|
Description for the status code of the Environment. Returned: when supported |
|
Returns the captured CDP SDK log. Returned: when supported |
|
Returns a list of each line of the captured CDP SDK log. Returned: when supported |