netapp.storagegrid.na_sg_org_container – Manage buckets on StorageGRID.

Note

This plugin is part of the netapp.storagegrid collection (version 21.9.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 netapp.storagegrid.

To use it in a playbook, specify: netapp.storagegrid.na_sg_org_container.

New in version 20.6.0: of netapp.storagegrid

Synopsis

  • Create S3 buckets on NetApp StorageGRID.

Parameters

Parameter Choices/Defaults Comments
api_url
string / required
The url to the StorageGRID Admin Node REST API.
auth_token
string / required
The authorization token for the API request
compliance
dictionary
Configure compliance settings for an S3 bucket.
Cannot be specified along with s3_object_lock_enabled.
auto_delete
boolean
    Choices:
  • no
  • yes
If enabled, objects will be deleted automatically when its retention period expires, unless the bucket is under a legal hold.
legal_hold
boolean
    Choices:
  • no
  • yes
If enabled, objects in this bucket cannot be deleted, even if their retention period has expired.
retention_period_minutes
integer
specify the length of the retention period for objects added to this bucket, in minutes.
name
string / required
Name of the bucket.
region
string
Set a region for the bucket.
s3_object_lock_enabled
boolean
added in 21.9.0 of netapp.storagegrid
    Choices:
  • no
  • yes
Enable S3 Object Lock on the bucket.
S3 Object Lock requires StorageGRID 11.5 or greater
state
string
    Choices:
  • present ←
  • absent
Whether the specified bucket should exist or not.
validate_certs
boolean
    Choices:
  • no
  • yes ←
Should https certificates be validated?

Notes

Note

  • The modules prefixed with na_sg are built to manage NetApp StorageGRID.

Examples

- name: create a s3 bucket
  netapp.storagegrid.na_sg_org_container:
    api_url: "https://<storagegrid-endpoint-url>"
    auth_token: "storagegrid-auth-token"
    validate_certs: false
    state: present
    name: ansiblebucket1

- name: delete a s3 bucket
  netapp.storagegrid.na_sg_org_container:
    api_url: "https://<storagegrid-endpoint-url>"
    auth_token: "storagegrid-auth-token"
    validate_certs: false
    state: absent
    name: ansiblebucket1

- name: create a s3 bucket with Object Lock
  netapp.storagegrid.na_sg_org_container:
    api_url: "https://<storagegrid-endpoint-url>"
    auth_token: "storagegrid-auth-token"
    validate_certs: false
    state: present
    name: objectlock-bucket1
    s3_object_lock_enaled: true

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
resp
dictionary
always
Returns information about the StorageGRID bucket.

Sample:
{'compliance': {'autoDelete': False, 'legalHold': False, 'retentionPeriodMinutes': 2629800}, 'creationTime': '2021-01-01T00:00:00.000Z', 'name': 'example-bucket', 'region': 'us-east-1', 's3ObjectLock': {'enabled': False}}


Authors