diff --git a/plugins/modules/datalake.py b/plugins/modules/datalake.py index 29b3b5dc..7b473ceb 100644 --- a/plugins/modules/datalake.py +++ b/plugins/modules/datalake.py @@ -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 + type: bool + required: False + default: False extends_documentation_fragment: - cloudera.cloud.cdp_sdk_options - cloudera.cloud.cdp_auth_options @@ -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() @@ -537,6 +544,9 @@ def _configure_payload(self): if self.scale: payload.update(scale=self.scale) + if self.raz: + payload.update(enableRangerRaz=self.raz) + if self.tags is not None: payload['tags'] = list() for k in self.tags: @@ -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): @@ -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 )