everpure.flashblade.purefb_bucket module – Manage Object Store Buckets on a Everpure FlashBlade.

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_bucket.

New in everpure.flashblade 1.0.0

Synopsis

  • This module managess object store (s3) buckets on Everpure 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

account

string / required

Object Store Account for Bucket.

api_token

string

FlashBlade API token for admin privileged user.

block_new_public_policies

boolean

added in everpure.flashblade 1.15.0

If set to true, adding bucket policies that grant public access to a bucket is not allowed.

Choices:

  • false

  • true

block_public_access

boolean

added in everpure.flashblade 1.15.0

If set to true, access to a bucket with a public policy is restricted to only authenticated users within the account that bucket belongs to.

Choices:

  • false

  • true

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

default_retention

string

added in everpure.flashblade 1.12.0

The retention period, in days, used to apply locks on new objects if none is specified by the S3 client

Valid values between 1 and 365000, given as a number of days (a trailing d is accepted, for example 7d)

Use “” to clear

On an existing bucket this is compared with the current value and changed when it differs. On a ratcheted bucket it can only be raised.

disable_warnings

boolean

added in everpure.flashblade 1.18.0

Disable insecure certificate warnings

Choices:

  • false ← (default)

  • true

eradicate

boolean

Define whether to eradicate the bucket on delete or leave in trash.

Choices:

  • false ← (default)

  • true

eradication_delay

integer

added in everpure.flashblade 1.17.0

Not settable per bucket. A bucket inherits its eradication delay from the array-wide eradication config (REST PATCH /arrays eradication_config.eradication_delay, CLI purearray eradication-config setattr); the REST API rejects the field on a bucket and this module fails when it is set.

The inherited value is reported by everpure.flashblade.purefb_info under buckets.<name>.eradication_config.

eradication_mode

string

added in everpure.flashblade 1.17.0

The eradication mode of the bucket.

This is the only per-bucket eradication setting the REST API accepts.

Switching to retention-based requires object lock on the bucket and is one-way; the array refuses to change the mode back to permission-based.

Choices:

  • "permission-based"

  • "retention-based"

fb_url

string

FlashBlade management IP address or Hostname.

freeze_locked_objects

boolean

added in everpure.flashblade 1.12.0

If set to true, a locked object will be read-only and no new versions of the object may be created due to modifications

After enabling, can be disabled only by contacting Pure Technical Services

The array rejects freeze_locked_objects=true together with versioning=enabled as an invalid combination

Choices:

  • false ← (default)

  • true

hard_limit

boolean

added in everpure.flashblade 1.12.0

Whether the quota value is enforced or not.

If not provided the object store account default value will be used.

Choices:

  • false

  • true

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).

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.

manual_eradication

boolean

added in everpure.flashblade 1.17.0

Not settable per bucket. A bucket inherits its manual eradication status from the array-wide eradication config (REST PATCH /arrays eradication_config.manual_eradication, CLI purearray eradication-config setattr); the REST API rejects the field on a bucket and this module fails when it is set.

The inherited value is reported by everpure.flashblade.purefb_info under buckets.<name>.eradication_config.

Choices:

  • false

  • true

mode

string

added in everpure.flashblade 1.10.0

The type of bucket to be created. Also referred to a VSO Mode.

multi-site-writable type can only be used after feature is enabled by Pure Technical Support

Choices:

  • "classic"

  • "multi-site-writable"

name

string / required

Bucket Name.

object_lock_enabled

boolean

added in everpure.flashblade 1.12.0

If set to true, then S3 APIs relating to object lock may be used

Choices:

  • false ← (default)

  • true

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.

quota

string

added in everpure.flashblade 1.12.0

The effective quota limit applied against the size of the bucket.

User byte quota in B, K, M, G, T or P units.

Range must be between 1 byte and 9.22 exabytes.

Setting to 0 will allow the bucket size to be unlimited.

retention_lock

string

added in everpure.flashblade 1.12.0

Set retention lock level for the bucket

Once set to ratcheted can only be lowered by Pure Technical Services

Choices:

  • "ratcheted"

  • "unlocked" ← (default)

retention_mode

string

added in everpure.flashblade 1.12.0

The retention mode used to apply locks on new objects if none is specified by the S3 client

safemode is available if global Per-Bucket Safemode config is enabled

Use “” to clear

Once set to compliance this can only be changed by contacting Pure Technical Services

Choices:

  • "compliance"

  • "governance"

  • "safemode"

  • ""

state

string

Create, delete or modifies a bucket.

Choices:

  • "present" ← (default)

  • "absent"

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.

versioning

string

State of S3 bucket versioning

If not specified, the current versioning state of the bucket is left unchanged

S3 versioning cannot be removed once enabled, so absent on an already versioned bucket suspends versioning rather than removing it

Choices:

  • "enabled"

  • "suspended"

  • "absent"

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 new bucket named foo in account bar
  everpure.flashblade.purefb_bucket:
    name: foo
    quota: 10G
    hard_limit: false
    account: bar
    fb_url: 10.10.10.2
    api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641

- name: Update bucket foo in account bar with new quota
  everpure.flashblade.purefb_bucket:
    name: foo
    quota: 500B
    hard_limit: true
    account: bar
    fb_url: 10.10.10.2
    api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641

- name: Remove quota limits from bucket named foo in account bar
  everpure.flashblade.purefb_bucket:
    name: foo
    quota: 0
    account: bar
    fb_url: 10.10.10.2
    api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641

- name: Delete bucket named foo in account bar
  everpure.flashblade.purefb_bucket:
    name: foo
    account: bar
    state: absent
    fb_url: 10.10.10.2
    api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641

- name: Change bucket versioning state
  everpure.flashblade.purefb_bucket:
    name: foo
    account: bar
    versioning: enabled
    fb_url: 10.10.10.2
    api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641

- name: Recover deleted bucket named foo in account bar
  everpure.flashblade.purefb_bucket:
    name: foo
    account: bar
    state: present
    fb_url: 10.10.10.2
    api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641

- name: Eradicate bucket named foo in account bar
  everpure.flashblade.purefb_bucket:
    name: foo
    account: bar
    state: absent
    eradicate: true
    fb_url: 10.10.10.2
    api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641

Authors

  • Everpure Ansible Team (@sdodsley)