purestorage.flashblade.purefb_bucket module – Manage Object Store Buckets on a Pure Storage FlashBlade.

Note

This module is part of the purestorage.flashblade collection (version 1.19.2).

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 purestorage.flashblade. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: purestorage.flashblade.purefb_bucket.

New in purestorage.flashblade 1.0.0

Synopsis

  • This module managess object store (s3) buckets on Pure Storage FlashBlade.

Requirements

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

  • python >= 3.9

  • py-pure-client

  • purity_fb >= 1.12.2

  • 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 purestorage.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 purestorage.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

default_retention

string

added in purestorage.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

Use “” to clear

disable_warnings

boolean

added in purestorage.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 purestorage.flashblade 1.17.0

Minimum eradication delay in days. Automatically eradicate destroyed buckets after the delay time passes unless automatic eradication is delayed due to other configuration values.

Valid values are integer days from 1 to 30. Default is 1.

eradication_mode

string

added in purestorage.flashblade 1.17.0

The eradication mode of the bucket.

Choices:

  • "permission-based"

  • "retention-based"

fb_url

string

FlashBlade management IP address or Hostname.

freeze_locked_objects

boolean

added in purestorage.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

Choices:

  • false ← (default)

  • true

hard_limit

boolean

added in purestorage.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

manual_eradication

boolean

added in purestorage.flashblade 1.17.0

The manual eradication status of the bucket. If false, the bucket cannot be eradicated after it has been destroyed, unless it is empty. If true, the bucket can be eradicated.

Choices:

  • false

  • true

mode

string

added in purestorage.flashblade 1.10.0

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

Requires Purity//FB 3.3.3 or higher

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 purestorage.flashblade 1.12.0

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

Choices:

  • false ← (default)

  • true

quota

string

added in purestorage.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 purestorage.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 purestorage.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"

versioning

string

State of S3 bucket versioning

Choices:

  • "enabled"

  • "suspended"

  • "absent" ← (default)

Notes

Note

  • This module requires the purity_fb Python library

  • You must set PUREFB_URL and PUREFB_API environment variables if fb_url and api_token arguments are not passed to the module directly

Examples

- name: Create new bucket named foo in account bar
  purestorage.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
  purestorage.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
  purestorage.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
  purestorage.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
  purestorage.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
  purestorage.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
  purestorage.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

  • Pure Storage Ansible Team (@sdodsley)