dellemc.powerscale.dellemc_powerscale_filesystem (1.4.0) — module

Manage Filesystems on PowerScale

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

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

preview | supported by community

Install collection

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


Add to requirements.yml

  collections:
    - name: dellemc.powerscale
      version: 1.4.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: "{{powerscalehost}}"
     port: "{{powerscaleport}}"
     verify_ssl: "{{verify_ssl}}"
     username: "{{user}}"
     password: "{{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"
     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: "{{powerscalehost}}"
      port: "{{powerscaleport}}"
      verify_ssl: "{{verify_ssl}}"
      username: "{{user}}"
      password: "{{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: "{{powerscalehost}}"
     port: "{{powerscaleport}}"
     verify_ssl: "{{verify_ssl}}"
     username: "{{user}}"
     password: "{{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: "{{powerscalehost}}"
     port: "{{powerscaleport}}"
     verify_ssl: "{{verify_ssl}}"
     username: "{{user}}"
     password: "{{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: "{{powerscalehost}}"
      port: "{{powerscaleport}}"
      verify_ssl: "{{verify_ssl}}"
      username: "{{user}}"
      password: "{{password}}"
      path: "<path>"
      access_zone: "{{access_zone}}"
      quota:
        hard_limit_size: 15
        cap_unit: "GB"
        quota_state: "present"
      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: "{{powerscalehost}}"
      port: "{{powerscaleport}}"
      verify_ssl: "{{verify_ssl}}"
      username: "{{user}}"
      password: "{{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: 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: Delete filesystem
    dellemc_powerscale_filesystem:
     onefs_host: "{{powerscalehost}}"
     port: "{{powerscaleport}}"
     verify_ssl: "{{verify_ssl}}"
     username: "{{user}}"
     password: "{{password}}"
     access_zone: "{{access_zone}}"
     path: "<path>"
     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. - name(str), - provider_type(str).
    - If you specify  a group, then the corresponding name is mandatory.
    - The provider_type is optional, it defaults to 'local'.
    - The supported values for provider_type are 'local', 'file', 'ldap' and 'ads'.
    type: dict

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

quota:
    description:
    - The Smart Quota for the filesystem. Only directory Quotas are supported.
    - The following sub-options are supported for Quota. - include_snap_data(boolean),
      - include_data_protection_overhead(boolean), - thresholds_on(app_logical_size, fs_logical_size,
      physical_size) - advisory_limit_size(int), - soft_limit_size(int), - hard_limit_size(int),
      - cap_unit (MB, GB or TB), - quota_state (present or absent).
    - The default grace period is 7 days. Modification of grace period is not supported.
    - The default capacity unit is GB.
    - The parameter include_data_protection_overhead is supported for SDK 8.1.1
    - For SDK 9.0.0 the parameter include_data_protection_overhead is deprecated and thresholds_on
      is used.
    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 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.
    - True - indicates that the SSL certificate should be verified.
    - 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 'private_read' ,
      'private' , 'public_read', 'public_read_write', 'public' or in POSIX format (eg
      0700).
    - Modification of ACL is only supported from POSIX to POSIX mode.
    type: str

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

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.
  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 list_snapshots is True.
  type: complex
quota_details:
  contains:
    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.
      sample:
        inodes: 1
        logical: 0
        physical: 2048
      type: dict
  description: The quota details.
  returned: When Quota exists.
  type: complex