Skip to content

Commit

Permalink
Add upgrade_backup parameter to datalake module
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Enright <jenright@cloudera.com>
  • Loading branch information
jimright committed Dec 12, 2024
1 parent b5239de commit 51c6561
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion plugins/modules/datalake.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@
type: bool
required: False
default: False
upgrade_backup:
description:
- Flag to specify if a backup should be taken during the datalake backup
type: bool
required: False
default: True
extends_documentation_fragment:
- cloudera.cloud.cdp_sdk_options
- cloudera.cloud.cdp_auth_options
Expand Down Expand Up @@ -470,6 +476,7 @@ def __init__(self, module):

self.upgrade = self._get_param("upgrade")
self.rolling_upgrade = self._get_param("rolling_upgrade")
self.upgrade_backup = self._get_param("upgrade_backup")

# Initialize the return values
self.datalake = dict()
Expand Down Expand Up @@ -656,7 +663,7 @@ def upgrade_datalake(self):
if self.upgrade in ["os", "full"]:
# upgrade if os or full
self.cdpy.datalake.datalake_upgrade(
datalake_name=self.name, rolling_upgrade=self.rolling_upgrade
datalake_name=self.name, rolling_upgrade=self.rolling_upgrade, skip_backup=(not self.upgrade_backup)
)
upgrade_performed = True

Expand Down Expand Up @@ -943,6 +950,11 @@ def main():
type="bool",
default=False,
),
upgrade_backup=dict(
required=False,
type="bool",
default=True,
),
),
supports_check_mode=True,
)
Expand Down

0 comments on commit 51c6561

Please sign in to comment.