Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion plugins/modules/datalake.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@
default: 3600
aliases:
- polling_timeout
raz:
description:
- Flag indicating if Ranger RAZ fine grained access should be enabled for the datalake
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also should add entry for the response, which now includes enableRangerRaz

type: bool
required: False
default: False
extends_documentation_fragment:
- cloudera.cloud.cdp_sdk_options
- cloudera.cloud.cdp_auth_options
Expand Down Expand Up @@ -394,6 +400,7 @@ def __init__(self, module):
self.delay = self._get_param('delay')
self.timeout = self._get_param('timeout')
self.force = self._get_param('force')
self.raz = self._get_param("raz")

# Initialize the return values
self.datalake = dict()
Expand Down Expand Up @@ -537,6 +544,9 @@ def _configure_payload(self):
if self.scale:
payload.update(scale=self.scale)

if self.raz:
payload.update(enableRangerRaz=self.raz)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not supported yet in GCP last time I checked, so will need a guard condition


if self.tags is not None:
payload['tags'] = list()
for k in self.tags:
Expand Down Expand Up @@ -576,6 +586,12 @@ def _reconcile_existing_state(self, existing):
"need to change the tags, explicitly delete "
"and recreate the Datalake.")

if self.raz:
self.module.warn("Updating an existing Datalake's 'enableRangerRaz' "
"directly is not supported at this time. If you "
"need to change the enableRangerRaz, explicitly delete "
"and recreate the Datalake.")

return mismatched

def _validate_datalake_name(self):
Expand Down Expand Up @@ -603,7 +619,8 @@ def main():
force=dict(required=False, type='bool', default=False),
wait=dict(required=False, type='bool', default=True),
delay=dict(required=False, type='int', aliases=['polling_delay'], default=15),
timeout=dict(required=False, type='int', aliases=['polling_timeout'], default=3600)
timeout=dict(required=False, type='int', aliases=['polling_timeout'], default=3600),
raz=dict(required=False, type="bool", default=False)
),
supports_check_mode=True
)
Expand Down