m1yag1.globus.globus_collection module – Manage Globus Collections

Note

This module is part of the m1yag1.globus collection (version 0.6.0).

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 m1yag1.globus.

To use it in a playbook, specify: m1yag1.globus.globus_collection.

New in m1yag1.globus 1.0.0

Synopsis

  • Create, update, or delete Globus Collections

  • Configure collection access and permissions

Parameters

Parameter

Comments

auth_method

string

Authentication method to use.

If not specified, auto-detects based on available credentials.

When client_id and client_secret are provided, uses client_credentials.

Otherwise falls back to cli (reads tokens from globus-cli storage).

Choices:

  • "client_credentials"

  • "cli"

client_id

string

Globus Auth client ID for client_credentials authentication.

Can also be set via the GLOBUS_CLIENT_ID environment variable.

client_secret

string

Globus Auth client secret for client_credentials authentication.

Can also be set via the GLOBUS_CLIENT_SECRET environment variable.

collection_type

string

Type of collection

Choices:

  • "mapped" ← (default)

  • "guest"

contact_email

string

Contact email for the collection

description

string

Description of the collection

endpoint_id

string / required

ID of the endpoint hosting this collection

identity_id

string

Identity ID for guest collections

keywords

list / elements=string

Keywords for the collection

name

string / required

Display name of the collection

organization

string

Organization name

path

string / required

Path on the endpoint for this collection

public

boolean

Whether the collection should be public

Choices:

  • false ← (default)

  • true

state

string

Desired state of the collection

Choices:

  • "present" ← (default)

  • "absent"

user_credential_id

string

User credential ID for guest collections

Notes

Note

  • Authentication is required for all Globus API operations.

  • For client_credentials auth, register a confidential client at https://developers.globus.org.

  • For cli auth, run globus login first to cache tokens.

  • The cli method reads tokens from ~/.globus/cli/storage.db.

  • For cli auth with multiple profiles, set GLOBUS_PROFILE environment variable.

  • Set GLOBUS_SDK_ENVIRONMENT to sandbox or test for non-production environments.

See Also

See also

Globus Auth Documentation

Official Globus authentication documentation

Globus CLI

Command-line interface for Globus

Examples

# Basic mapped collection
- name: Create a mapped collection
  globus_collection:
    name: "Research Data Collection"
    endpoint_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
    collection_type: "mapped"
    path: "/data/research/"
    description: "Shared research data repository"
    organization: "University Research Lab"
    contact_email: "admin@university.edu"
    public: true
    keywords:
      - "research"
      - "data"
    state: present

# Genomics data collection with comprehensive metadata
- name: Create genomics data collection
  globus_collection:
    name: "Genomics Data"
    endpoint_id: "{{ gcs_endpoint.endpoint_id }}"
    path: "/data/genomics"
    collection_type: mapped
    description: "Genomics research data repository for sequencing projects"
    organization: "Biology Department"
    contact_email: "genomics-admin@university.edu"
    public: true
    keywords:
      - genomics
      - research
      - biology
      - sequencing
      - NGS
    state: present

# Private collaboration collection
- name: Create private collaboration collection
  globus_collection:
    name: "Multi-Inst Collaboration Data"
    endpoint_id: "{{ collab_endpoint_id }}"
    path: "/shared/collab"
    collection_type: mapped
    description: "Private data sharing for multi-institutional collaboration"
    organization: "Research Consortium"
    contact_email: "consortium-admin@universities.org"
    public: false
    keywords:
      - collaboration
      - multi-institutional
      - private
    state: present

# Guest collection for user sharing
- name: Create guest collection for user
  globus_collection:
    name: "Personal Data Share - {{ user_name }}"
    endpoint_id: "{{ personal_endpoint_id }}"
    collection_type: "guest"
    path: "/home/{{ user_name }}/shared/"
    identity_id: "{{ user_name }}@university.edu"
    description: "Personal data sharing collection for {{ user_name }}"
    public: false
    state: present

# Multiple collections for GCS deployment
- name: Create storage collections on GCS
  globus_collection:
    name: "{{ item.name }}"
    endpoint_id: "{{ gcs_endpoint.endpoint_id }}"
    path: "{{ item.path }}"
    collection_type: mapped
    description: "{{ item.description }}"
    organization: "Research Computing"
    public: "{{ item.public | default(false) }}"
    keywords: "{{ item.keywords | default([]) }}"
    state: present
  loop:
    - name: "Home Directories"
      path: "/home"
      description: "User home directories"
      public: false
      keywords: ["home", "users"]
    - name: "Shared Research"
      path: "/research/shared"
      description: "Shared research data repository"
      public: true
      keywords: ["research", "shared", "public"]
    - name: "Scratch Space"
      path: "/scratch"
      description: "High-performance scratch storage"
      public: false
      keywords: ["scratch", "temporary", "hpc"]

# Collection with service credentials
- name: Create collection with service credentials
  globus_collection:
    name: "Production Data Repository"
    endpoint_id: "{{ production_endpoint_id }}"
    path: "/data/production"
    collection_type: mapped
    description: "Production data repository with automated management"
    organization: "Research Computing Services"
    contact_email: "data-services@university.edu"
    public: true
    client_id: "{{ vault_globus_client_id }}"
    client_secret: "{{ vault_globus_client_secret }}"
    keywords:
      - production
      - automated
      - research-data
    state: present

# Delete a collection
- name: Delete a collection
  globus_collection:
    name: "Old Collection"
    endpoint_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
    path: "/old/path/"
    state: absent

Return Values

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

Key

Description

changed

boolean

Whether the collection was changed

Returned: always

collection_id

string

ID of the created/managed collection

Returned: when state=present

name

string

Name of the collection

Returned: always

Authors

  • m1yag1