dellemc / dellemc.powerscale / 3.0.0 / module / filepoolpolicy Manages file pool policy on PowerScale | "added in version" 1.6.0 of dellemc.powerscale" Authors: Ananthu S Kuttattu (@kuttattz) <ansible.team@dell.com>dellemc.powerscale.filepoolpolicy (3.0.0) — module
Install with ansible-galaxy collection install dellemc.powerscale:==3.0.0
collections: - name: dellemc.powerscale version: 3.0.0
Managing file pool policy on PowerScale Storage System. This includes creating a new file pool policy, deleting a file pool policy and retrieving the details of a file pool policy.
- name: Get a file pool policy dellemc.powerscale.filepoolpolicy: onefs_host: "{{onefs_host}}" verify_ssl: "{{verify_ssl}}" api_user: "{{api_user}}" api_password: "{{api_password}}" policy_name: "test_11" state: 'present'
- name: Delete a file pool policy dellemc.powerscale.filepoolpolicy: onefs_host: "{{onefs_host}}" verify_ssl: "{{verify_ssl}}" api_user: "{{api_user}}" api_password: "{{api_password}}" policy_name: "test_11" state: 'absent'
- name: Create a file pool policy dellemc.powerscale.filepoolpolicy: onefs_host: "{{onefs_host}}" verify_ssl: "{{verify_ssl}}" api_user: "{{api_user}}" api_password: "{{api_password}}" policy_name: "test_policy_1" description: 'Creating a policy' apply_order: 1 apply_data_storage_policy: ssd_strategy: "SSD_metadata_read_acceleration" storagepool: "test_tier" set_data_access_pattern: "concurrency" set_requested_protection: "mirrored_over_3_nodes" set_write_performance_optimization: "enable_smartcache" file_matching_pattern: or_criteria: - and_criteria: - type: "file_name" condition: "does_not_match" value: "file_name_test" case_sensitive: true - type: "accessed" condition: "after" datetime_value: "2022-04-04 23:30" - type: "created" condition: "is_newer_than" relative_datetime_count: time_value: 12 time_unit: "years" - and_criteria: - type: "size" condition: "not_equal" size_info: size_value: 60 size_unit: "MB" - type: "file_attribute" condition: "does_not_match" field: "test_field" value: "uni" - type: "file_attribute" condition: "exists" field: "test" state: 'present'
state: choices: - absent - present description: - The state option is used to mention the existence of file pool policy. required: true type: str port_no: default: '8080' description: - Port number of the PowerScale cluster.It defaults to 8080 if not specified. required: false type: str api_user: description: - username of the PowerScale cluster. required: true type: str policy_id: description: - Unique Id of the file pool policy. - It is mutually exclusive with I(policy_name). type: str onefs_host: description: - IP address or FQDN of the PowerScale cluster. required: true type: str verify_ssl: choices: - true - false description: - boolean variable to specify whether to validate SSL certificate or not. - C(true) - indicates that the SSL certificate should be verified. - C(false) - indicates that the SSL certificate should not be verified. required: true type: bool apply_order: description: - The order in which the policy should be applied. - It is relative to other policies. type: int description: description: A description of the file pool policy. type: str policy_name: description: - Unique name of the file pool policy. - It is mutually exclusive with I(policy_id). - Mandatory for file pool policy creation. type: str api_password: description: - the password of the PowerScale cluster. required: true type: str file_matching_pattern: description: The file matching rules for the policy. suboptions: or_criteria: description: - or criteria conditions for the file policy. - Maximum of 3 criteria's is possible. elements: dict required: true suboptions: and_criteria: description: - The and criteria conditions for the file policy. - Maximum of 5 criteria is possible. elements: dict required: true suboptions: case_sensitive: description: - C(true) to indicate case sensitivity when comparing file attributes. - Required only if the I(type) is C(file_name) or C(file_path). type: bool condition: choices: - matches - does_not_match - contains - does_not_contain - after - before - is_newer_than - is_older_than - equal - not_equal - greater_than - greater_than_equal_to - less_than - less_than_equal_to - exists - does_not_exist description: - The condition to use while comparing an attribute with its value. - If I(type) is C(size) then the conditions are ['equal', 'not_equal', 'greater_than', 'greater_than_equal_to', 'less_than', 'less_than_equal_to']. - If I(type) is C(accessed) or C(created) or C(modified) or C(metadata_changed) then the conditions are ['after','before', 'is_newer_than', 'is_older_than']. - If I(type) is C(file_attribute) then the conditions are ['matches','does_not_match', 'exists', 'does_not_exist']. - If I(type) is C(file_path) then the conditions are ['matches','does_not_match', 'contains', 'does_not_contain']. - If I(type) is C(file_type) or C(file_name) then the conditions are ['matches','does_not_match']. type: str datetime_value: description: - Date and Time value. - Format is 'YYYY-MM-DD HOUR:MINUTE' - Required only if the I(type) is C(accessed) or C(created) or C(modified) or C(metadata_changed) and \ the I(condition) is C(after) or C(before) type: str field: description: - File attribute field name to be compared in a custom comparison. - Required only if the I(type) is C(file_attribute). type: str file_type_option: choices: - directory - file - other description: - File type option. - Required only if the I(type) is C(file_type). type: str relative_datetime_count: description: - A relative duration (e.g., 2 years, 3 weeks, 50 seconds). - Required only if the I(type) is C(accessed) or C(created) or C(modified) or C(metadata_changed) and \ the C(condition) is C(is_newer_than) or C(is_older_than) suboptions: time_unit: choices: - years - months - weeks - days - hours - minutes - seconds description: Unit for the relative time count required: true type: str time_value: description: Relative time count. required: true type: int type: dict size_info: description: - File size value and unit. - Required only if the I(type) is C(size). suboptions: size_unit: choices: - B - KB - MB - GB - TB - PB description: Unit for the size value required: true type: str size_value: description: Size value. required: true type: int type: dict type: choices: - file_name - file_type - file_path - file_attribute - accessed - created - modified - metadata_changed - size description: The file criteria to be compared to a given value. required: true type: str value: description: - The value to be compared against a file criteria. - Required in case if I(type) is C(file_name) or C(file_path) or C(file_attribute). - If I(type) is C(file_name) then value wil have file name. - If I(type) is C(file_path) then value wil have file path. - If I(type) is C(file_attribute) then value wil have file attribute field value. type: str type: list type: list type: dict set_data_access_pattern: choices: - random - concurrency - streaming description: Action to set data access pattern optimization. type: str set_requested_protection: choices: - default_protection_of_node_pool_or_tier - tolerate_failure_of_1_drive_or_1_node - tolerate_failure_of_2_drives_or_1_node - tolerate_failure_of_2_drives_or_2_nodes - tolerate_failure_of_3_drives_or_1_node - tolerate_failure_of_3_drives_or_(1_node_and_1drive) - tolerate_failure_of_3_drives_or_3_nodes - tolerate_failure_of_4_drives_or_1_node - tolerate_failure_of_4_drives_or_2_nodes - tolerate_failure_of_4_drives_or_4_nodes - mirrored_over_2_nodes - mirrored_over_3_nodes - mirrored_over_4_nodes - mirrored_over_5_nodes - mirrored_over_6_nodes - mirrored_over_7_nodes - mirrored_over_8_nodes description: Action to change requested protection. type: str apply_data_storage_policy: description: Action to move files to storage pool or tier. suboptions: ssd_strategy: choices: - SSD_metadata_read_acceleration - SSD_metadata_read_write_acceleration - avoid_SSD - SSD_for_metadata_and_data description: Strategy for ssd. type: str storagepool: default: anywhere description: Name of the storage pool. type: str type: dict apply_snapshot_storage_policy: description: Action to move snapshots to storage pool or tier. suboptions: ssd_strategy: choices: - SSD_metadata_read_acceleration - SSD_metadata_read_write_acceleration - avoid_SSD - SSD_for_metadata_and_data description: Strategy for ssd. type: str storagepool: default: anywhere description: Name of the storage pool. type: str type: dict set_write_performance_optimization: choices: - enable_smartcache - disable_smartcache description: Action to set write performance optimization. type: str
changed: description: Whether or not the resource has changed. returned: always sample: 'false' type: bool filepool_policy_details: contains: actions: description: List of action's available for the policy. type: list apply_order: description: The order in which policy is present with respect to other policies. type: int description: description: Description of the policy. type: str file_matching_pattern: contains: or_criteria: description: or criteria conditions for the file policy. type: list description: File matching pattern of the policy. type: complex id: description: Unique ID of the policy. type: int name: description: Unique name of the policy. type: str description: Policy details. returned: When a Policy exists sample: filepool_policy_details: actions: - action_param: 3x action_type: set_requested_protection - action_param: concurrency action_type: set_data_access_pattern - action_param: 'True' action_type: enable_coalescer - action_param: '{''ssd_strategy'': ''metadata'', ''storagepool'': ''test_tier''}' action_type: apply_data_storage_policy apply_order: 1 description: Creating a policy file_matching_pattern: or_criteria: - and_criteria: - attribute_exists: null begins_with: null case_sensitive: true field: null operator: '!=' type: name units: null use_relative_time: null value: we - and_criteria: - attribute_exists: null begins_with: null case_sensitive: false field: null operator: '!=' type: name units: null use_relative_time: null value: we - attribute_exists: null begins_with: null case_sensitive: false field: null operator: == type: name units: null use_relative_time: null value: we id: 25 name: test_policy type: complex