From 7190b186166e80654b0352f1a2b4ead32ff10cf5 Mon Sep 17 00:00:00 2001 From: maorlipchuk Date: Wed, 17 Jan 2018 11:48:27 +0200 Subject: [PATCH] Add missing storage domain properties (#34904) * Add additional properties to storage domains * add warn low space for additional storage properties * Fixing comments 1. Fixing documentation 2. Use default None 3. Remove redundant if condition 4. remove added discard since it was already added * Apply comments #2 Fix default value to None Use percentages instead of GB --- .../cloud/ovirt/ovirt_storage_domains.py | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_storage_domains.py b/lib/ansible/modules/cloud/ovirt/ovirt_storage_domains.py index ef280505568..90ea3fb13f8 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_storage_domains.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_storage_domains.py @@ -115,6 +115,22 @@ options: - "C(port) - Port of the fibre channel storage server." - "C(lun_id) - LUN id." - "Note that these parameters are not idempotent." + wipe_after_delete: + description: + - "Boolean flag which indicates whether the storage domain should wipe the data after delete." + version_added: "2.5" + backup: + description: + - "Boolean flag which indicates whether the storage domain is configured as backup or not." + version_added: "2.5" + critical_space_action_blocker: + description: + - "Inidcates the minimal free space the storage domain should contain in percentages." + version_added: "2.5" + warning_low_space: + description: + - "Inidcates the minimum percentage of a free space in a storage domain to present a warning." + version_added: "2.5" destroy: description: - "Logical remove of the storage domain. If I(true) retains the storage domain's data for import." @@ -174,6 +190,10 @@ EXAMPLES = ''' - 1IET_000d0001 - 1IET_000d0002 address: 10.34.63.204 + discard_after_delete: True + backup: False + critical_space_action_blocker: 5 + warning_low_space: 10 # Add data glusterfs storage domain - ovirt_storage_domains: @@ -193,6 +213,10 @@ EXAMPLES = ''' nfs: address: 10.34.63.199 path: /path/export + wipe_after_delete: False + backup: True + critical_space_action_blocker: 2 + warning_low_space: 5 # Import export NFS storage domain: - ovirt_storage_domains: @@ -299,6 +323,10 @@ class StorageDomainModule(BaseModule): name=self._module.params['name'], description=self._module.params['description'], comment=self._module.params['comment'], + wipe_after_delete=self._module.params['wipe_after_delete'], + backup=self._module.params['backup'], + critical_space_action_blocker=self._module.params['critical_space_action_blocker'], + warning_low_space_indicator=self._module.params['warning_low_space'], import_=( True if self._module.params['state'] == 'imported' else None @@ -545,6 +573,10 @@ def main(): posixfs=dict(default=None, type='dict'), glusterfs=dict(default=None, type='dict'), fcp=dict(default=None, type='dict'), + wipe_after_delete=dict(type='bool', default=None), + backup=dict(type='bool', default=None), + critical_space_action_blocker=dict(type='int', default=None), + warning_low_space=dict(type='int', default=None), destroy=dict(type='bool', default=False), format=dict(type='bool', default=False), discard_after_delete=dict(type='bool', default=True)