Skip to content

Commit 5b64506

Browse files
authored
Add support for CDE (part 2 - virtual clusters) (#40)
* DE changes to support virtual cluster definitions Signed-off-by: curtishoward <curtis@cloudera.com>
1 parent 421bc3c commit 5b64506

File tree

4 files changed

+689
-24
lines changed

4 files changed

+689
-24
lines changed

docs/_sources/index.rst.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ cloudera.cloud Ansible Collection
4242
ml_workspace_access <ml_workspace_access>
4343
opdb <opdb>
4444
opdb_info <opdb_info>
45-
de <de>
46-
de_info <de_info>
4745

4846
This repository hosts the ``cloudera.cloud`` Ansible collection. The collection includes modules and other Ansible
4947
assets to help automate the provisioning and use of Cloudera Data Platform (CDP) experiences, datalakes, and

plugins/modules/de.py

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -183,24 +183,20 @@
183183
'''
184184

185185
EXAMPLES = r'''
186-
# Sample definition for a DE service
187-
de:
188-
definitions:
189-
- name: cde-cloudera-deploy-example
190-
instance_type: "m5.2xlarge"
191-
minimum_instances: 2
192-
maximum_instances: 4
193-
minimum_spot_instances: 0
194-
maximum_spot_instances: 0
195-
enable_public_endpoint: yes
196-
enable_workload_analytics: yes
197-
initial_instances: 2
198-
initial_spot_instances: 0
199-
root_volume_size: 100
200-
chart_value_overrides: [{"chartName":"dex-app", "overrides":"dexapp.api.gangScheduling.enabled:true"}]
201-
skip_validation: yes
202-
tags: {"cde-cloudera-deploy-example":"v0.0.1"}
203-
use_ssd: yes
186+
# Create a DE service using defaults for optional parameters and wait for completion
187+
- cloudera.cloud.de:
188+
name: cde-cloudera-deploy-example
189+
env: cdp-environment-name
190+
instance_type: "m5.2xlarge"
191+
state: present
192+
wait: yes
193+
194+
# Remove a DE service without waiting
195+
- cloudera.cloud.de:
196+
name: cde-cloudera-deploy-example+
197+
env: cdp-environment-name
198+
state: absent
199+
wait: no
204200
'''
205201

206202
RETURN = r'''
@@ -367,12 +363,10 @@ def __init__(self, module):
367363
# Execute logic process
368364
self.process()
369365

366+
370367
@CdpModule._Decorators.process_debug
371368
def process(self):
372-
for service in self.cdpy.de.list_services(env=self.env, remove_deleted=True):
373-
if service['name'] == self.name:
374-
self.cluster_id = service['clusterId']
375-
break
369+
self.cluster_id = self.cdpy.de.get_service_id_by_name(name=self.name, env=self.env)
376370
initial_desc = self.cdpy.de.describe_service(self.cluster_id) if self.cluster_id else None
377371

378372
# If a service under the name/env pair was found (excluding disabled services)

0 commit comments

Comments
 (0)