Collection Galaxy metadata structure
A key component of an Ansible collection is the galaxy.yml
file placed in the root directory of a collection. Thisfile 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 |
---|---|
namespacestring/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 characters and underscores. Additionally namespaces cannot start with underscores or numbers and cannot contain consecutive underscores. |
namestring/required | The name of the collection.Has the same character restrictions as namespace . |
versionstring/required | The version of the collection.Must be compatible with semantic versioning. |
readmestring/required | The path to the Markdown (.md) readme file.This path is relative to the root of the collection. |
authorslist/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’. |
descriptionstring | A short summary description of the collection. |
licenselist | Either a single license or a list of licenses for content inside of a collection.Ansible Galaxy currently only accepts SPDX licensesThis key is mutually exclusive with license_file . |
license_filestring | 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 . |
tagslist | 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 . |
dependenciesdictionary | 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 , . |
repositorystring | The URL of the originating SCM repository. |
documentationstring | The URL to any online docs. |
homepagestring | The URL to the homepage of the collection/project. |
issuesstring | 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 <[email protected]>"
- 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