Collection Galaxy metadata structure

A key component of an Ansible collection is the galaxy.yml file placed in the root directory of a collection. This file contains the metadata of the collection that is used to generate a collection artifact.

Structure

The galaxy.yml file must contain the following keys in valid YAML:

Key

Comment

namespace

string 

required

The namespace of the collection.

This can be a company/brand/organization or product namespace under which all content lives.

May only contain alphanumeric lowercase characters and underscores. Namespaces cannot start with underscores or numbers and cannot contain consecutive underscores.

name

string 

required

The name of the collection.

Has the same character restrictions as namespace.

version

string 

required

The version of the collection.

Must be compatible with semantic versioning.

readme

string 

required

The path to the Markdown (.md) readme file.

This path is relative to the root of the collection.

authors

list 

required

A list of the collection’s content authors.

Can be just the name or in the format ‘Full Name <email> (url) @nicks:irc/im.site#channel’.

description

string 

A short summary description of the collection.

license

list 

Either a single license or a list of licenses for content inside of a collection.

Ansible Galaxy currently only accepts SPDX licenses

This key is mutually exclusive with license_file.

license_file

string 

The path to the license file for the collection.

This path is relative to the root of the collection.

This key is mutually exclusive with license.

tags

list 

A list of tags you want to associate with the collection for indexing/searching.

A tag name has the same character requirements as namespace and name.

dependencies

dictionary 

Collections that this collection requires to be installed for it to be usable.

The key of the dict is the collection label namespace.name.

The value is a version range specifiers.

Multiple version range specifiers can be set and are separated by ,.

repository

string 

The URL of the originating SCM repository.

documentation

string 

The URL to any online docs.

homepage

string 

The URL to the homepage of the collection/project.

issues

string 

The URL to the collection issue tracker.

Examples

namespace: "namespace_name"
name: "collection_name"
version: "1.0.12"
readme: "README.md"
authors:
    - "Author1"
    - "Author2 (https://author2.example.com)"
    - "Author3 <author3@example.com>"
dependencies:
    "other_namespace.collection1": ">=1.0.0"
    "other_namespace.collection2": ">=2.0.0,<3.0.0"
    "anderson55.my_collection": "*"    # note: "*" selects the highest version available
license:
    - "MIT"
tags:
    - demo
    - collection
repository: "https://www.github.com/my_org/my_collection"

See also

Developing collections

Develop or modify a collection.

Ansible module development: getting started

Learn about how to write Ansible modules

Using collections

Learn how to install and use collections.

Mailing List

The development mailing list

irc.freenode.net

#ansible IRC chat channel