W3cubDocs

/Ansible 2.10

purestorage.flasharray.purefa_policy – Manage FlashArray File System Policies

Note

This plugin is part of the purestorage.flasharray collection.

To install it use: ansible-galaxy collection install purestorage.flasharray.

To use it in a playbook, specify: purestorage.flasharray.purefa_policy.

New in version 1.5.0: of purestorage.flasharray

Synopsis

  • Manage FlashArray file system policies for NFS, SMB and snapshot

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 2.7
  • purestorage >= 1.19
  • py-pure-client >= 1.6.0
  • netaddr

Parameters

Parameter Choices/Defaults Comments
api_token
string
FlashArray API token for admin privileged user.
client
string
Specifies which SMB or NFS clients are given access
Accepted notation, IP, IP mask, or hostname
enabled
boolean
    Choices:
  • no
  • yes
Define if policy is enabled or not
fa_url
string
FlashArray management IPv4 address or Hostname.
name
string / required
Name of the policy
nfs_access
string
    Choices:
  • root-squash
  • no-root-squash
Specifies access control for the export
nfs_permission
string
    Choices:
  • ro
  • rw
Specifies which read-write client access permissions are allowed for the export
policy
string / required
    Choices:
  • nfs
  • smb
  • snapshot
The type of policy to use
rename
string
New name of policy
smb_anon_allowed
boolean
    Choices:
  • no
  • yes
Specifies whether access to information is allowed for anonymous users
smb_encrypt
boolean
    Choices:
  • no
  • yes
Specifies whether the remote client is required to use SMB encryption
snap_at
string
Specifies the number of hours since midnight at which to take a snapshot or the hour including AM/PM
Can only be set on the rule with the smallest snap_every value.
Cannot be set if the snap_every value is not measured in days.
Can only be set for at most one rule in the same policy.
snap_client_name
string
The customizable portion of the client visible snapshot name.
snap_every
integer
Specifies the interval between snapshots, in minutes.
The value for all rules must be multiples of one another.
Must be unique for each rule in the same policy.
Value must be between 5 and 525600.
snap_keep_for
integer
Specifies the period that snapshots are retained before they are eradicated, in minutes.
Cannot be less than the snap_every value of the rule.
Value must be unique for each rule in the same policy.
Value must be between 5 and 525600.
state
string
    Choices:
  • absent
  • present
Define whether the policy should exist or not.

Notes

Note

  • This module requires the purestorage Python library
  • You must set PUREFA_URL and PUREFA_API environment variables if fa_url and api_token arguments are not passed to the module directly

Examples

- name: Create an NFS policy with no rules
  purefa_policy:
    name: export1
    policy: nfs
    nfs_access: no-root-squash
    nfs_permission: ro
    client: client1
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Create an NFS policy with initial rule
  purefa_policy:
    name: export1
    policy: nfs
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Disable a policy
  purefa_policy:
    name: export1
    enabled: false
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Add rule to existing NFS export policy
  purefa_policy:
    name: export1
    policy: nfs
    nfs_access: no-root-squash
    nfs_permission: ro
    client: client2
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Add rule to existing SMB export policy
  purefa_policy:
    name: export1
    policy: nfs
    smb_encrypt: yes
    smb_anon_allowed: no
    client: client1
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Delete policy rule for a client
  purefa_policy:
    name: export1
    policy: nfs
    client: client2
    state: absent
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Delete policy
  purefa_policy:
    name: export1
    policy: nfs
    state: absent
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

Authors

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/purestorage/flasharray/purefa_policy_module.html