dellemc.powerstore.quota (3.2.0) — module

Manage Tree Quotas and User Quotas on PowerStore

| "added in version" 1.1.0 of dellemc.powerstore"

Authors: P Srinivas Rao (@srinivas-rao5) <ansible.team@dell.com>

Install collection

Install with ansible-galaxy collection install dellemc.powerstore:==3.2.0


Add to requirements.yml

  collections:
    - name: dellemc.powerstore
      version: 3.2.0

Description

Managing Quotas on PowerStore storage system includes getting details, modifying, creating and deleting Quotas.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a Quota for a User using unix name
  dellemc.powerstore.quota:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    quota_type: "user"
    unix_name: "{{unix_name}}"
    filesystem: "sample_fs"
    nas_server: "{{nas_server_id}}"
    quota:
      soft_limit: 5
      hard_limit: 10
    cap_unit: "TB"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a Tree Quota
  dellemc.powerstore.quota:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    quota_type: "tree"
    path: "/home"
    filesystem: "sample_fs"
    nas_server: "sample_nas_server"
    quota:
      soft_limit: 5
      hard_limit: 10
      cap_unit: "TB"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify attributes for Tree Quota
  dellemc.powerstore.quota:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    quota_id: "{{quota_id}}"
    quota:
      soft_limit: 10
      hard_limit: 15
      cap_unit: "TB"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get details of User Quota
  dellemc.powerstore.quota:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    quota_type: "user"
    uid: 100
    path: "/home"
    filesystem: "{{filesystem_id}}"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get details of Tree Quota
  dellemc.powerstore.quota:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    quota_id: "{{quota_id}}"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete a Tree Quota
  dellemc.powerstore.quota:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    quota_type: "tree"
    path: "/home"
    filesystem: "sample_fs"
    nas_server: "sample_nas_server"
    state: "absent"

Inputs

    
uid:
    description:
    - The ID of the unix user account for which quota operations will be performed.
    - Any one among C(uid)/C(unix_name)/C(windows_name)/C(windows_sid) is required when
      I(quota_type) is C(user).
    type: int

path:
    description:
    - The path on which the quota will be imposed.
    - Path is relative to the root of the filesystem.
    - For user quota, if I(path) is not specified, quota will be created at the root of
      the filesystem.
    type: str

port:
    description:
    - Port number for the PowerStore array.
    - If not passed, it will take 443 as default.
    type: int

user:
    description:
    - The username of the PowerStore host.
    required: true
    type: str

quota:
    description:
    - Specifies Quota parameters.
    suboptions:
      cap_unit:
        choices:
        - GB
        - TB
        default: GB
        description:
        - Unit of storage for the hard and soft limits.
        - This parameter is required if limit is specified.
        type: str
      hard_limit:
        description:
        - Hard limit of the user quota.
        - No hard limit when set to C(0).
        type: int
      soft_limit:
        description:
        - Soft limit of the User/Tree quota.
        - No Soft limit when set to C(0).
        type: int
    type: dict

state:
    choices:
    - absent
    - present
    description:
    - Define whether the Quota should exist or not.
    - Value C(present)  indicates that the Quota should exist on the system.
    - Value C(absent)  indicates that the Quota should not exist on the system.
    required: true
    type: str

timeout:
    default: 120
    description:
    - Time after which the connection will get terminated.
    - It is to be mentioned in seconds.
    type: int

array_ip:
    description:
    - IP or FQDN of the PowerStore management system.
    required: true
    type: str

password:
    description:
    - The password of the PowerStore host.
    required: true
    type: str

quota_id:
    description:
    - Id of the user/tree quota.
    - If I(quota_id) is mentioned, then I(path)/I(nas_server)/I(file_system)/I(quota_type)
      is not required.
    type: str

unix_name:
    description:
    - The name of the unix user account for which quota operations will be performed.
    - Any one among C(uid)/C(unix_name)/C(windows_name)/C(windows_sid) is required when
      I(quota_type) is C(user).
    type: str

filesystem:
    description:
    - The ID/Name of the filesystem for which the Tree/User Quota  will be created.
    - If filesystem name is specified, then I(nas_server) is required to uniquely identify
      the filesystem.
    type: str

nas_server:
    description:
    - The NAS server. This could be the name or ID of the NAS server.
    type: str

quota_type:
    choices:
    - user
    - tree
    description:
    - The type of quota which will be imposed.
    type: str

description:
    description:
    - Additional information that can be mentioned for a Tree Quota.
    - Description parameter can only be used when I(quota_type) is C(tree).
    type: str

windows_sid:
    description:
    - The SID of the Windows User account for which quota operations will be performed.
    - Any one among C(uid)/C(unix_name)/C(windows_name)/C(windows_sid) is required when
      I(quota_type) is C(user).
    type: str

windows_name:
    description:
    - The name of the Windows User for which quota operations will be performed.
    - The name should be mentioned along with Domain Name as 'DOMAIN_NAME\user_name' or
      as "DOMAIN_NAME\\user_name".
    - Any one among C(uid)/C(unix_name)/C(windows_name)/C(windows_sid) is required when
      I(quota_type) is C(user).
    type: str

validate_certs:
    aliases:
    - verifycert
    default: true
    description:
    - Boolean variable to specify whether to validate SSL certificate or not.
    - C(true) - indicates that the SSL certificate should be verified. Set the environment
      variable REQUESTS_CA_BUNDLE to the path of the SSL certificate.
    - C(false) - indicates that the SSL certificate should not be verified.
    type: bool

Outputs

changed:
  description: Whether or not the resource has changed.
  returned: always
  sample: 'true'
  type: bool
quota_details:
  contains:
    description:
      description: Additional information about the tree quota. Only applicable for
        Tree Quotas.
      sample: Sample Tree quota's description
      type: str
    file_system:
      contains:
        filesystem_type:
          description: Type of filesystem.
          sample: Primary
          type: str
        id:
          description: ID of filesystem.
          sample: 5f73f516-e67b-b179-8901-72114981c1f3
          type: str
        name:
          description: Name of filesystem.
          sample: sample_filesystem
          type: str
        nas_server:
          description: nas_server of filesystem.
          type: dict
      description: Includes ID and Name of filesystem and nas server for which smb
        share exists.
      type: complex
    hard_limit(cap_unit):
      description: Value of the Hard Limit imposed on the quota.
      sample: '4.0'
      type: int
    id:
      description: The ID of the Quota.
      sample: 2nQKAAEAAAAAAAAAAAAAQIMCAAAAAAAA
      type: str
    remaining_grace_period:
      description: The time period remaining after which the grace period will expire.
      sample: 86400
      type: int
    size_used:
      description: Size currently consumed by Tree/User on the filesystem.
      type: int
    soft_limit(cap_unit):
      description: Value of the Soft Limit imposed on the quota.
      sample: '2.0'
      type: int
    state:
      description: State of the user quota or tree quota record period. OK means No
        quota limits are exceeded. Soft_Exceeded means Soft limit is exceeded, and
        grace period is not expired. Soft_Exceeded_And_Expired means Soft limit is
        exceeded, and grace period is expired. Hard_Reached means Hard limit is reached.
      sample: Ok
      type: str
    state_l10n:
      description: Localized message string corresponding to state.
      sample: Ok
      type: str
    tree_quota_for_user_quota:
      contains:
        description:
          description: Description of Tree Quota for user quota.
          sample: Primary
          type: str
        hard_limit(cap_unit):
          description: Value of the Hard Limit imposed on the quota.
          sample: '2.0'
          type: int
        path:
          description: The path on which the quota will be imposed.
          sample: /sample_path
          type: str
      description: Additional Information of Tree Quota limits on which user quota
        exists. Only applicable for User Quotas.
      type: complex
    tree_quota_id:
      description: ID of the Tree Quota on which the specific User Quota exists. Only
        applicable for user quotas.
      type: str
    uid:
      description: The ID of the unix host for which user quota exists. Only applicable
        for user quotas.
      type: int
    unix_name:
      description: The Name of the unix host for which user quota exists. Only applicable
        for user quotas.
      type: str
    windows_name:
      description: The Name of the Windows host for which user quota exists. Only
        applicable for user quotas.
      type: str
    windows_sid:
      description: The SID of the windows host for which user quota exists. Only applicable
        for user quotas.
      type: str
  description: The quota details.
  returned: When Quota exists.
  sample:
    description: Tree quota created on filesystem
    file_system:
      filesystem_type: Primary
      id: 61d68a87-6000-3cc3-f816-96e8abdcbab0
      name: sample_file_system
      nas_server:
        id: 60c0564a-4a6e-04b6-4d5e-fe8be1eb93c9
        name: ansible_nas_server_2
    hard_limit(GB): '90.0'
    id: 00000006-08f2-0000-0200-000000000000
    is_user_quotas_enforced: false
    path: /sample_file_system
    remaining_grace_period: -1
    size_used: 0
    soft_limit(GB): '50.0'
    state: Ok
  type: complex