netapp.storagegrid.na_sg_org_container (21.12.0) — module

Manage buckets on StorageGRID.

| "added in version" 20.6.0 of netapp.storagegrid"

Authors: NetApp Ansible Team (@joshedmonds) <ng-ansibleteam@netapp.com>

preview | supported by community

Install collection

Install with ansible-galaxy collection install netapp.storagegrid:==21.12.0


Add to requirements.yml

  collections:
    - name: netapp.storagegrid
      version: 21.12.0

Description

Create S3 buckets on NetApp StorageGRID.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - 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_enabled: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: create a s3 bucket with versioning enabled
    netapp.storagegrid.na_sg_org_container:
      api_url: "https://<storagegrid-endpoint-url>"
      auth_token: "storagegrid-auth-token"
      validate_certs: false
      state: present
      name: ansiblebucket1
      bucket_versioning_enabled: true

Inputs

    
name:
    description:
    - Name of the bucket.
    required: true
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Whether the specified bucket should exist or not.
    type: str

region:
    description:
    - Set a region for the bucket.
    type: str

api_url:
    description:
    - The url to the StorageGRID Admin Node REST API.
    required: true
    type: str

auth_token:
    description:
    - The authorization token for the API request
    required: true
    type: str

compliance:
    description:
    - Configure compliance settings for an S3 bucket.
    - Cannot be specified along with I(s3_object_lock_enabled).
    suboptions:
      auto_delete:
        description:
        - If enabled, objects will be deleted automatically when its retention period
          expires, unless the bucket is under a legal hold.
        type: bool
      legal_hold:
        description:
        - If enabled, objects in this bucket cannot be deleted, even if their retention
          period has expired.
        type: bool
      retention_period_minutes:
        description:
        - specify the length of the retention period for objects added to this bucket,
          in minutes.
        type: int
    type: dict

validate_certs:
    default: true
    description:
    - Should https certificates be validated?
    required: false
    type: bool

s3_object_lock_enabled:
    description:
    - Enable S3 Object Lock on the bucket.
    - S3 Object Lock requires StorageGRID 11.5 or greater.
    type: bool
    version_added: 21.9.0
    version_added_collection: netapp.storagegrid

bucket_versioning_enabled:
    description:
    - Enable versioning on the bucket.
    - This API requires StorageGRID 11.6 or greater.
    type: bool
    version_added: 21.11.0
    version_added_collection: netapp.storagegrid

Outputs

resp:
  description: Returns information about the StorageGRID bucket.
  returned: always
  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
  type: dict