dellemc.powerscale.filesystem (3.0.0) — module

Manage Filesystems on PowerScale

| "added in version" 1.2.0 of dellemc.powerscale"

Authors: Prashant Rakheja (@prashant-dell) <ansible.team@dell.com>, Trisha Datta (@trisha-dell) <ansible.team@dell.com>

Install collection

Install with ansible-galaxy collection install dellemc.powerscale:==3.0.0


Add to requirements.yml

  collections:
    - name: dellemc.powerscale
      version: 3.0.0

Description

Managing Filesystems on PowerScale Storage System includes Create a new Filesystem, Delete a Filesystem, Get details of a filesystem, Modify a Filesystem (Quota, ACLs).


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create Filesystem with Quota in given access zone
  dellemc.powerscale.filesystem:
    onefs_host: "{{onefs_host}}"
    port_no: "{{powerscaleport}}"
    verify_ssl: "{{verify_ssl}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    path: "<path>"
    access_zone: "{{access_zone}}"
    owner:
      name: 'ansible_user'
      provider_type: 'ldap'
    group:
      name: 'ansible_group'
      provider_type: 'ldap'
      access_control: "{{access_control}}"
    quota:
      include_snap_data: false
      include_data_protection_overhead: false
      advisory_limit_size: 2
      soft_limit_size: 5
      hard_limit_size: 10
      cap_unit: "GB"
      quota_state: "present"
      container: true
      recursive: "{{recursive}}"
    state: "{{state_present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create Filesystem in default (system) access zone, without Quota
  dellemc.powerscale.filesystem:
    onefs_host: "{{onefs_host}}"
    port_no: "{{powerscaleport}}"
    verify_ssl: "{{verify_ssl}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    path: "<path>"
    owner:
    name: 'ansible_user'
    provider_type: 'ldap'
    state: "{{state_present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get filesystem details
  dellemc.powerscale.filesystem:
    onefs_host: "{{onefs_host}}"
    port_no: "{{powerscaleport}}"
    verify_ssl: "{{verify_ssl}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    access_zone: "{{access_zone}}"
    path: "<path>"
    state: "{{state_present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get filesystem details with snapshots
  dellemc.powerscale.filesystem:
    onefs_host: "{{onefs_host}}"
    port_no: "{{powerscaleport}}"
    verify_ssl: "{{verify_ssl}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    access_zone: "{{access_zone}}"
    path: "<path>"
    list_snapshots: "{{list_snapshots_true}}"
    state: "{{state_present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify Filesystem Hard Quota
  dellemc.powerscale.filesystem:
    onefs_host: "{{onefs_host}}"
    port_no: "{{powerscaleport}}"
    verify_ssl: "{{verify_ssl}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    path: "<path>"
    access_zone: "{{access_zone}}"
    quota:
    hard_limit_size: 15
    cap_unit: "GB"
    quota_state: "present"
    container: true
    state: "{{state_present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify Filesystem Owner, Group and ACL
  dellemc.powerscale.filesystem:
    onefs_host: "{{onefs_host}}"
    port_no: "{{powerscaleport}}"
    verify_ssl: "{{verify_ssl}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    path: "<path>"
    access_zone: "{{access_zone}}"
    owner:
      name: 'ansible_user'
      provider_type: 'ldap'
    group:
      name: 'ansible_group'
      provider_type: 'ldap'
      access_control: "{{new_access_control}}"
    state: "{{state_present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify Filesystem to add access control rights
  dellemc.powerscale.filesystem:
    onefs_host: "{{onefs_host}}"
    port_no: "{{powerscaleport}}"
    verify_ssl: "{{verify_ssl}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    path: "/ifs/test"
    access_zone: "{{access_zone}}"
    access_control_rights:
    access_type: "allow"
    access_rights:
      - dir_gen_all
    inherit_flags:
      - container_inherit
    trustee:
      name: test_user
      provider_type: "ldap"
    access_control_rights_state: "add"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify Filesystem to remove access control rights
  dellemc.powerscale.filesystem:
    onefs_host: "{{onefs_host}}"
    port_no: "{{powerscaleport}}"
    verify_ssl: "{{verify_ssl}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    path: "/ifs/test"
    access_zone: "{{access_zone}}"
    access_control_rights:
    access_type: "allow"
    access_rights:
      - dir_gen_all
    inherit_flags:
      - container_inherit
    trustee:
      name: test_user
      provider_type: "ldap"
    access_control_rights_state: "remove"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove Quota from FS
  dellemc.powerscale.filesystem:
    onefs_host: "{{onefs_host}}"
    verify_ssl: "{{verify_ssl}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    path: "<path>"
    access_zone: "{{access_zone}}"
    quota:
      quota_state: "absent"
    state: "{{state_present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create Filesystem with access control rights for everyone
  dellemc.powerscale.filesystem:
    onefs_host: "{{onefs_host}}"
    port_no: "{{powerscaleport}}"
    verify_ssl: "{{verify_ssl}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    path: "/ifs/test"
    access_zone: "{{access_zone}}"
    access_control_rights:
    access_type: "allow"
    access_rights:
      - dir_gen_all
    inherit_flags:
      - container_inherit
    trustee:
      name: "everyone"
      type: "wellknown"
    access_control_rights_state: "add"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete filesystem
  dellemc.powerscale.filesystem:
    onefs_host: "{{onefs_host}}"
    port_no: "{{powerscaleport}}"
    verify_ssl: "{{verify_ssl}}"
    api_user: "{{user}}"
    api_password: "{{api_password}}"
    access_zone: "{{access_zone}}"
    path: "<path>"
    recursive_force_delete: "{{recursive_force_delete}}"
    state: "{{state_absent}}"

Inputs

    
path:
    description:
    - This is the directory path. It is the absolute path for System access zone and is
      relative if using a non-System access zone. For example, if your access zone is
      'Ansible' and it has a base path '/ifs/ansible' and the path specified is '/user1',
      then the effective path would be '/ifs/ansible/user1'. If your access zone is System,
      and you have 'directory1' in the access zone, the path provided should be '/ifs/directory1'.
    required: true
    type: str

group:
    description:
    - The group of the Filesystem.
    - The following sub-options are supported for Group. - I(name(str)), - I(provider_type(str)).
    - If you specify  a group, then the corresponding name is mandatory.
    - The I(provider_type) is optional, it defaults to C(local).
    - The supported values for I(provider_type) are C(local), C(file), C(ldap) and C(ads).
    type: dict

owner:
    description:
    - The owner of the Filesystem.
    - This parameter is required when creating a Filesystem.
    - The following sub-options are supported for Owner. - I(name(str)), - I(provider_type(str)).
    - If you specify owner, then the corresponding name is mandatory.
    - The I(provider_type) is optional and it defaults to C(local).
    - The supported values for I(provider_type) are C(local), C(file), C(ldap) and C(ads).
    type: dict

quota:
    description:
    - The Smart Quota for the filesystem. Only directory Quotas are supported.
    - The following sub-options are supported for Quota.
    suboptions:
      advisory_limit_size:
        description:
        - The threshold value after which the advisory notification will be sent.
        type: int
      cap_unit:
        choices:
        - GB
        - TB
        description:
        - Unit of storage for the hard, soft and advisory limits.
        - This parameter is required if any of the hard, soft or advisory limits is specified.
        type: str
      container:
        default: false
        description: If C(true), SMB shares using the quota directory see the quota thresholds
          as share size.
        type: bool
      hard_limit_size:
        description:
        - Threshold value after which a hard limit exceeded notification will be sent.
        - Write access will be restricted after the hard limit is exceeded.
        type: int
      include_data_protection_overhead:
        description:
        - Whether to include the data protection overheads in the quota or not.
        - If not passed during quota creation then quota will be created excluding the
          overheads.
        - This parameter is supported for SDK 8.1.1
        type: bool
      include_snap_data:
        default: false
        description:
        - Whether to include the snapshots in the quota or not.
        type: bool
      quota_state:
        choices:
        - absent
        - present
        description: Defines whether the quota should exist or not
        type: str
      soft_limit_size:
        description:
        - Threshold value after which the soft limit exceeded notification will be sent
          and the I(soft_grace) period will start.
        - Write access will be restricted after the grace period expires.
        - Both I(soft_grace_period) and I(soft_limit_size) are required to modify soft
          threshold for the quota.
        type: int
      thresholds_on:
        choices:
        - app_logical_size
        - fs_logical_size
        - physical_size
        description:
        - For SDK 9.1.0 the parameter I(include_overheads) is deprecated and I(thresholds_on)
          is used.
        type: str
    type: dict

state:
    choices:
    - absent
    - present
    description:
    - Defines whether the Filesystem should exist or not.
    - A filesystem with NFS exports or SMB shares cannot be deleted.
    - Any Quotas on the Filesystem need to be removed before deleting the filesystem.
    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

recursive:
    default: true
    description:
    - Creates intermediate folders recursively when set to C(true).
    type: bool

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

access_zone:
    default: System
    description:
    - The access zone. If no Access Zone is specified, the 'System' access zone would
      be taken by default.
    type: str

api_password:
    description:
    - the password of the PowerScale cluster.
    required: true
    type: str

access_control:
    description:
    - The ACL value for the directory.
    - At the time of creation, users can either provide input such as C(private_read)
      , C(private) , C(public_read), C(public_read_write), C(public) or in C(POSIX) format
      (eg 0700).
    - Modification of ACL is only supported from C(POSIX) to C(POSIX) mode.
    - This field is mutually exclusive with I(access_control_rights).
    type: str

list_snapshots:
    default: false
    description:
    - If set to C(true), the filesystem's snapshots are returned.
    type: bool

access_control_rights:
    description:
    - Manage user rights and set ACL permissions for files and directories.
    suboptions:
      access_rights:
        description:
        - Provides the list of access rights that are defined for the directory.
        elements: str
        type: list
      access_type:
        choices:
        - allow
        - deny
        description:
        - Allows or denies access to the directory based on the access rights set for
          the trustee.
        required: true
        type: str
      inherit_flags:
        choices:
        - object_inherit
        - container_inherit
        - inherit_only
        - no_prop_inherit
        - inherited_ace
        description:
        - Provides the inherit flags set for the directory.
        elements: str
        type: list
      trustee:
        description:
        - Provides the trustee (user or group) name and trustee I(provider_type).
        required: true
        suboptions:
          name:
            description:
            - Provides the trustee (user or group) name.
            required: true
            type: str
          provider_type:
            default: local
            description:
            - The I(provider_type) is optional and it defaults to C(local).
            - The supported values for I(provider_type) are C(local), C(file), C(ldap)
              and C(ads).
            type: str
          type:
            choices:
            - user
            - group
            - wellknown
            default: user
            description:
            - Provides the trustee type.
            type: str
        type: dict
    type: dict

recursive_force_delete:
    default: false
    description:
    - Deletes sub files and folders recursively when set to C(true) even if the filesystem
      is not empty.
    type: bool

access_control_rights_state:
    choices:
    - add
    - remove
    description:
    - Specifies if the access rights are to be added or deleted for the trustee.
    - It is required together with I(access_control_rights).
    type: str

Outputs

changed:
  description: Whether or not the resource has changed.
  returned: always
  sample: 'true'
  type: bool
filesystem_details:
  contains:
    attrs:
      description: The attributes of the filesystem.
      type: dict
  description: The filesystem details.
  returned: When Filesystem exists.
  sample:
    attrs:
    - name: owner
      namespace: null
      value: user
    - name: group
      namespace: null
      value: group
    - name: mode
      namespace: null
      value: '0750'
    namespace_acl:
      acl:
      - accessrights:
        - dir_gen_all
        accesstype: allow
        inherit_flags:
        - container_inherit
        op: add
        trustee:
          id: id:2001
          name: user
          type: user
      action: replace
      authoritative: acl
      group:
        id: '123'
        name: group
        type: group
      mode: '0750'
      owner:
        id: '123'
        name: user
        type: user
  type: complex
filesystem_snapshots:
  contains:
    created:
      description: The creation timestamp.
      sample: 1581069354
      type: int
    expires:
      description: The expiration timestamp.
      sample: 2581069354
      type: int
    id:
      description: The id of the snapshot.
      sample: 1524
      type: int
    name:
      description: The name of the snapshot.
      sample: ansible_snapshot
      type: str
    path:
      description: The path of the snapshot.
      sample: /ifs/ansible/ansible281825
      type: str
  description: The filesystem snapshot details.
  returned: When I(list_snapshots) is true.
  sample:
    alias: null
    created: 1636393464
    expires: null
    has_locks: false
    id: 4
    name: SIQ-latest
    path: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER
    pct_filesystem: 2.435778242215747e-06
    pct_reserve: 0.0
    schedule: null
    shadow_bytes: 0
    size: 4096
    state: active
    target_id: null
    target_name: null
  type: complex
quota_details:
  contains:
    container:
      description: If (true), SMB shares using the quota directory see the quota thresholds
        as share size.
      sample: true
      type: bool
    enforced:
      description: Whether the Quota is enforced.
      sample: true
      type: bool
    id:
      description: The ID of the Quota.
      sample: 2nQKAAEAAAAAAAAAAAAAQIMCAAAAAAAA
      type: str
    type:
      description: The type of Quota.
      sample: directory
      type: str
    usage:
      description: The Quota usage.
      type: dict
  description: The quota details.
  returned: When Quota exists.
  sample:
    inodes: 1
    logical: 0
    physical: 2048
  type: complex