everpure.flasharray.purefa_server module – Manage Everpure FlashArray file servers

Note

This module is part of the everpure.flasharray collection (version 1.46.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install everpure.flasharray. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: everpure.flasharray.purefa_server.

New in everpure.flasharray 1.45.0

Synopsis

Requirements

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

  • python >= 3.3

  • purestorage >= 1.19

  • py-pure-client >= 1.88.0

  • netaddr

  • requests

  • pycountry

  • urllib3

Parameters

Parameter

Comments

api_token

string

FlashArray API token for admin privileged user.

cascade_delete

list / elements=string

Resource types to delete along with the file server, for objects that would otherwise block its deletion.

directory-services is the only value the array accepts.

This does not remove a local directory service created for the server, which outlives it and has to be deleted separately.

Only applies when state=absent.

client_id

string

added in everpure.flasharray 1.43.0

ID of the API Client that issues the identity token.

Used with private_key_file.

context

string

Name of fleet member on which to perform the operation.

This requires the array receiving the request is a member of a fleet and the context name to be a member of the same fleet.

Default: ""

create_local_directory_service

string

Name of a local directory service for the array to create and associate with the file server.

Only applies when the file server is created. Ignored for a file server that already exists.

Mutually exclusive with local_directory_service.

directory_service

string

Name of the directory service configuration the file server authenticates against, as managed by everpure.flasharray.purefa_ds.

This is a directory service the file server can see. The array’s own management directory service is not one of them.

Set to an empty string to detach the current directory service.

disable_warnings

boolean

added in everpure.flasharray 1.29.0

Disable insecure certificate warnings in debug logs

Choices:

  • false ← (default)

  • true

dns

string

Name of the DNS configuration the file server uses.

This is a DNS configuration created by everpure.flasharray.purefa_dns, either the one with service=file or one created without a service. Each file server needs a configuration of its own, so only the first can take the file one; the others are created without a service.

A new file server is given the array’s management DNS configuration by default, so this is for moving one onto a DNS configuration of its own.

Set to an empty string to detach the current DNS configuration.

Not enough on its own to create a file server. See directory_service.

fa_url

string

FlashArray management IPv4 address or Hostname.

id_token

string

added in everpure.flasharray 1.43.0

A pre-signed JWT to authenticate with, as an alternative to api_token.

The token is exchanged by the array for a short-lived access token.

Requires a matching API Client to be registered on the array (see everpure.flasharray.purefa_apiclient).

issuer

string

added in everpure.flasharray 1.43.0

The API Client’s trusted identity issuer registered on the array.

Used with private_key_file.

key_id

string

added in everpure.flasharray 1.43.0

Key ID of the API Client that issues the identity token.

Used with private_key_file.

local_directory_service

string

Name of an existing local directory service to associate with the file server.

A local directory service belongs to one file server at a time, so this fails if another file server already has it.

Mutually exclusive with create_local_directory_service.

name

string / required

Name of the file server.

network_interfaces

list / elements=string

Names of the network interfaces the file server is reachable on, such as the file VIFs created by everpure.flasharray.purefa_network.

Declarative. Interfaces in the list that are not attached to this file server are attached, and interfaces attached to it that are not in the list are detached. An empty list detaches all of them.

Omit the option to leave the file server’s interfaces alone. Detaching an interface stops clients reaching the file server through it, so this only ever acts on a task that names the interfaces explicitly.

An interface can be attached to one file server at a time.

private_key_file

string

added in everpure.flasharray 1.43.0

Path to the PEM RSA private key used to sign an identity token, as an alternative to api_token.

Requires client_id, key_id, issuer and username.

private_key_password

string

added in everpure.flasharray 1.43.0

Password protecting private_key_file, if encrypted.

rename

string

Value to rename the specified file server to.

state

string

Define whether the file server should exist or not.

Choices:

  • "absent"

  • "present" ← (default)

username

string

added in everpure.flasharray 1.43.0

Username the issued token should be granted to.

Must be a valid user on the array. Used with private_key_file.

Notes

Note

  • Requires Purity//FA REST API 2.44 or higher, which is where file servers first appear.

  • A file server cannot be created from a name alone. One of directory_service, local_directory_service or create_local_directory_service is required.

  • This module requires the py-pure-client Python library.

  • Additional Python libraries may be required for specific modules.

  • You must set PUREFA_URL and PUREFA_API environment variables if fa_url and api_token arguments are not passed to the module directly.

  • Token-based authentication (id_token, or private_key_file with client_id, key_id, issuer and username) may be used as an alternative to api_token, and requires a matching API Client registered on the array via everpure.flasharray.purefa_apiclient.

Examples

- name: Create file server the way the GUI does - network, DNS and directory service
  everpure.flasharray.purefa_server:
    name: filesvr1
    dns: filesvr1-dns
    create_local_directory_service: filesvr1-lds
    network_interfaces:
      - filevif1
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Create file server joined to an existing directory service
  everpure.flasharray.purefa_server:
    name: filesvr2
    directory_service: filesvr2-ds
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Move an existing file server onto a different DNS configuration
  everpure.flasharray.purefa_server:
    name: filesvr2
    dns: new-dns
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Detach the directory service from a file server
  everpure.flasharray.purefa_server:
    name: filesvr2
    directory_service: ""
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Rename file server
  everpure.flasharray.purefa_server:
    name: filesvr2
    rename: filesvr3
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Delete file server, along with the directory services only it uses
  everpure.flasharray.purefa_server:
    name: filesvr1
    cascade_delete:
      - directory-services
    state: absent
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

Authors

  • Everpure Ansible Team (@sdodsley)