everpure.flashblade.purefb_s3user module – Create or delete FlashBlade Object Store account users

Note

This module is part of the everpure.flashblade collection (version 1.29.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.flashblade. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: everpure.flashblade.purefb_s3user.

New in everpure.flashblade 1.0.0

Synopsis

  • Create or delete object store account users on a Pure Stoage FlashBlade.

Requirements

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

  • python >= 3.9

  • py-pure-client

  • netaddr

  • datetime

  • pytz

  • distro

  • pycountry

  • urllib3

Parameters

Parameter

Comments

access_key

boolean

Create secret access key.

Key can be exposed using the debug module

If enabled this will override imported_key

Choices:

  • false ← (default)

  • true

account

string / required

The name of object store account associated with user

api_token

string

FlashBlade API token for admin privileged user.

client_id

string

added in everpure.flashblade 1.26.0

ID of the API Client that issues the identity token.

Used with private_key_file.

context

string

added in everpure.flashblade 1.22.0

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: ""

disable_warnings

boolean

added in everpure.flashblade 1.18.0

Disable insecure certificate warnings

Choices:

  • false ← (default)

  • true

enable_key

boolean

added in everpure.flashblade 1.20.0

Is the access key enabled?

Choices:

  • false

  • true ← (default)

fb_url

string

FlashBlade management IP address or Hostname.

id_token

string

added in everpure.flashblade 1.26.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.flashblade.purefb_apiclient).

imported_key

string

added in everpure.flashblade 1.4.0

Access key of imported credentials

The key and secret must be a pair generated by a FlashBlade (Purity//FB 3.0.0 or later). The array validates the pair and rejects anything else with “The access key/secret key combination provided is invalid or unable to be imported”; the module then fails with that error.

imported_secret

string

added in everpure.flashblade 1.4.0

Access key secret for access key to import

issuer

string

added in everpure.flashblade 1.26.0

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

Used with private_key_file.

key_id

string

added in everpure.flashblade 1.26.0

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

Used with private_key_file.

key_name

aliases: remove_key

string

added in everpure.flashblade 1.5.0

Access key to be modified

multiple_keys

boolean

added in everpure.flashblade 1.12.0

Allow multiple access keys to be created for the user.

Choices:

  • false ← (default)

  • true

name

string / required

The name of object store user

policy

list / elements=string

added in everpure.flashblade 1.6.0

User Access Policies to be assigned to user on creation

To amend policies use the everpure.flashblade.purefb_userpolicy module

If not specified, the user is created with whatever policies the array assigns by default. Current Purity//FB releases assign none, so a user created without policy has no access policies until some are added.

private_key_file

string

added in everpure.flashblade 1.26.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.flashblade 1.26.0

Password protecting private_key_file, if encrypted.

state

string

Create or delete object store account user

Remove a specified access key for a user

Choices:

  • "absent"

  • "present" ← (default)

  • "remove_key"

  • "keystate"

username

string

added in everpure.flashblade 1.26.0

Username the issued token should be granted to.

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

Notes

Note

  • You must set PUREFB_URL and PUREFB_API environment variables if fb_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.flashblade.purefb_apiclient

Examples

- name: Create object store user (with access ID and key) foo in account bar
  everpure.flashblade.purefb_s3user:
    name: foo
    account: bar
    access_key: true
    fb_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
  register: result

- debug:
    msg: "S3 User: {{ result['s3user_info'] }}"

- name: Create object store user (with access ID and key) foo in account bar with access policy
  everpure.flashblade.purefb_s3user:
    name: foo
    account: bar
    access_key: true
    policy:
      - pure:policy/object-write
    fb_url: 10.10.10.2
    api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641

- name: Create object store user foo using imported key/secret in account bar
  everpure.flashblade.purefb_s3user:
    name: foo
    account: bar
    imported_key: "PSABSSZRHPMEDKHMAAJPJBONPJGGDDAOFABDGLBJLHO"
    imported_secret: "BAG61F63105e0d3669/e066+5C5DFBE2c127d395LBGG"
    fb_url: 10.10.10.2
    api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641

- name: Delete object store user foo in account bar
  everpure.flashblade.purefb_s3user:
    name: foo
    account: bar
    state: absent
    fb_url: 10.10.10.2
    api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641

- name: Change state of object store access key to disabled
  everpure.flashblade.purefb_s3user:
    name: foo
    account: bar
    key_name: PSFBSAZRDHFKAMIEGIBLIEDDOFLHGEEEEFCBPBFCLJ
    state: keystate
    enable_key: false
    fb_url: 10.10.10.2
    api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641

- name: Delete object store access key
  everpure.flashblade.purefb_s3user:
    name: foo
    account: bar
    key_name: PSFBSAZRDHFKAMIEGIBLIEDDOFLHGEEEEFCBPBFCLJ
    state: remove_key
    fb_url: 10.10.10.2
    api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641

Authors

  • Everpure Ansible Team (@sdodsley)